Documentation

ImageUtils
in package

Miscellaneous image operations.

Table of Contents

Methods

compressImageQuality()  : void
Compresses the quality of the provided MiniMagick image.
resizeImage()  : void
Resizes a provided MiniMagick Image with the given width & height, if present.
toCURLFile()  : CURLFile
Converts an Imagick into a valid CURLFile handle.
toMagickImage()  : Imagick

Methods

compressImageQuality()

Compresses the quality of the provided MiniMagick image.

public static compressImageQuality(Imagick $image[, int $quality = 85 ]) : void
Parameters
$image : Imagick

Imagick image handle.

$quality : int = 85

Quality to apply to the image. This operation is independent of a JPG's base quality.

Tags
throws
ImagickException

Throws if compression fails.

resizeImage()

Resizes a provided MiniMagick Image with the given width & height, if present.

public static resizeImage(Imagick $image[, int|null $width = null ][, int|null $height = null ]) : void
Parameters
$image : Imagick

Imagick image handle.

$width : int|null = null

Width to comply with.

$height : int|null = null

Height to comply with.

Tags
throws
ImagickException

Throws if resizing fails.

toCURLFile()

Converts an Imagick into a valid CURLFile handle.

public static toCURLFile(Imagick $image) : CURLFile
Parameters
$image : Imagick

Imagick image handle.

Tags
throws
MindeeImageException

Throws if the image can't be converted back into a CURLFile.

Return values
CURLFile

toMagickImage()

public static toMagickImage(mixed $image) : Imagick
Parameters
$image : mixed

Image handle.

Tags
throws
MindeeImageException

Throws if something goes wrong during image conversion.

Return values
Imagick

A valid Imagick handle, CURLFile, SplFileObject or resource. The resulting image is formatted to jpeg.


        
On this page

Search results