ImageCompressor
in package
Image compressor class to handle image compression.
Table of Contents
Methods
- compress() : string
Methods
compress()
public
static compress(string $inputImage[, int $quality = 85 ][, int|null $maxWidth = null ][, int|null $maxHeight = null ]) : string
Parameters
- $inputImage : string
-
Raw bytes of the input image.
- $quality : int = 85
-
Quality to apply to the image (JPEG compression).
- $maxWidth : int|null = null
-
Maximum width to constrain the image to. Defaults to the image's size if unset.
- $maxHeight : int|null = null
-
Maximum Height to constrain the image to. Defaults to the image's size if unset.
Tags
Return values
string —Raw bytes of the compressed JPEG image.