Documentation

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
throws
MindeeImageException

Throws if image processing fails.

MindeeUnhandledException

Throws if the bernard_ledit extension isn't loaded.

Return values
string —

Raw bytes of the compressed JPEG image.

On this page

Search results