I'm using imagick 3.7.0 compiled against ImageMagick 7.0.10-23 Q16 x86_64
In previous versions of imagick, I could resize an image with the width specified but the height unlimited using this command, where $width is a specific size but null is intended to mean unlimited for the height:
resizeImage($width, null, imagick::FILTER_LANCZOS, 1);
With the new imagick I've loaded to use PHP 8.1, the null is throwing an error on my server:
Imagick::resizeImage(): Passing null to parameter #2 ($rows) of type int is deprecated
What is the proper argument to supply to the second parameter in this case?
Many thanks!
if you pass
$bestFit=true
, the image keeps the scale.$width
and$height
are treated as max-with and max-height. So if you pass a very large$height
, the image-size will be limited be the provided$width
. For example:See: http://www.phpimagick.com/Imagick/resizeImage?width=200&height=500&blur=1&filter_type=Lanczos&crop=Disabled&best_fit=Enabled&image_path=Lorikeet