Function __global->cms_imagesave
Definitions
sources/images.php
- Save a GD image.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $image | resource | No | No | required parameter | N/A | N/A | Image resource |
| $path | PATH | No | No | required parameter | N/A | N/A | Path to save to |
| $ext | ?string | No | No | Null | N/A | N/A | File extension (null: get from path) |
| $lossy | boolean | No | No | False | N/A | N/A | Allow optional lossy compression |
| &$unknown_format | ?boolean | Yes | No | Null | N/A | N/A | Returned by reference as true if the file format was unknown (null: not passed) |
Returns
- Image resource (false: error)
- Type: ~resource
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Save a GD image.
*
* @param resource $image Image resource
* @param PATH $path Path to save to
* @param ?string $ext File extension (null: get from path)
* @param boolean $lossy Allow optional lossy compression
* @param ?boolean $unknown_format Returned by reference as true if the file format was unknown (null: not passed)
* @return ~resource Image resource (false: error)
*/
function cms_imagesave($image, string $path, ?string $ext = null, bool $lossy = false, ?bool &$unknown_format = null)
* Save a GD image.
*
* @param resource $image Image resource
* @param PATH $path Path to save to
* @param ?string $ext File extension (null: get from path)
* @param boolean $lossy Allow optional lossy compression
* @param ?boolean $unknown_format Returned by reference as true if the file format was unknown (null: not passed)
* @return ~resource Image resource (false: error)
*/
function cms_imagesave($image, string $path, ?string $ext = null, bool $lossy = false, ?bool &$unknown_format = null)

