note 107779 added to imagick.resizeimage
| From: | Spitfires | Date: | Sun, 04 Mar 2012 09:39:35 +0000 |
| Subject: | note 107779 added to imagick.resizeimage | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186483@lists.php.net to get a copy of this message | ||
To avoid upscaling when using the "bestfit" param, check the image dimensions before
resizing:
<?php
$image = new Imagick( $filename );
$imageprops = $image->getImageGeometry();
if ($imageprops['width'] <= 200 && $imageprops['height'] <= 200)
{
// don't upscale
} else {
$image->resizeImage(200,200, imagick::FILTER_LANCZOS, 0.9, true);
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 82.152.19.97
----
Manual Page -- http://www.php.net/manual/en/imagick.resizeimage.php
Edit -- https://master.php.net/note/edit/107779
Del: integrated -- https://master.php.net/note/delete/107779/integrated
Del: useless -- https://master.php.net/note/delete/107779/useless
Del: bad code -- https://master.php.net/note/delete/107779/bad+code
Del: spam -- https://master.php.net/note/delete/107779/spam
Del: non-english -- https://master.php.net/note/delete/107779/non-english
Del: in docs -- https://master.php.net/note/delete/107779/in+docs
Del: other reasons-- https://master.php.net/note/delete/107779
Reject -- https://master.php.net/note/reject/107779
Search -- https://master.php.net/manage/user-notes.php