php8.5
Home/ Manual/ imagick / imagick/ Imagick::cropThumbnailImage

Imagick::cropThumbnailImage

PHP function Edit on GitHub ✎

(PECL imagick 2, PECL imagick 3)

Creates a crop thumbnail

Description

Imagick::cropThumbnailImage(int $width, int $height, bool $legacy = false): bool

Creates a fixed size thumbnail by first scaling the image up or down and cropping a specified area from the center.

Parameters

width

The width of the thumbnail

height

The Height of the thumbnail

legacy

Optional bool parameter. If set to true, the calculations are done with the small rounding bug that existed in Imagick before 3.4.0. If set to false, the calculations should produce the same results as the ImageMagick command-line tools.

Return Values

Success

Errors/Exceptions

Throws

Changelog

VersionDescription
PECL imagick 3.4.0Added the legacy parameter.

Source: reference/imagick/imagick/cropthumbnailimage.xml · from the official PHP manual (php/doc-en)