note 86832 added to function.imagick-resizeimage
| From: | billadoid | Date: | Wed, 05 Nov 2008 19:50:44 +0000 |
| Subject: | note 86832 added to function.imagick-resizeimage | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146183@lists.php.net to get a copy of this message | ||
$height=$thumb->getImageHeight();
$width=$thumb->getImageWidth();
if ($height < $width)
$thumb->scaleImage(800,0);
else
$thumb->scaleImage(0,600);
Something like this will cause a fatal error when you try to create a thumbnail of an uploaded
picture of.. 10x15000 resolution.
It will work nice only if you enable the 'fit':
$height=$thumb->getImageHeight();
$width=$thumb->getImageWidth();
if ($width > 800)
$thumb->scaleImage(800,600,true);
if ($height > 600)
$thumb->scaleImage(800,600,true);
Note: Maybe I misspelled something or though something wrong. i.e. you could think why would I
create a thumbnail of 800x600.
Hope it will helps s/o
----
Server IP: 85.196.20.153
Probable Submitter: 85.73.161.152
----
Manual Page -- http://www.php.net/manual/en/function.imagick-resizeimage.php
Edit -- https://master.php.net/note/edit/86832
Del: integrated -- https://master.php.net/note/delete/86832/integrated
Del: useless -- https://master.php.net/note/delete/86832/useless
Del: bad code -- https://master.php.net/note/delete/86832/bad+code
Del: spam -- https://master.php.net/note/delete/86832/spam
Del: non-english -- https://master.php.net/note/delete/86832/non-english
Del: in docs -- https://master.php.net/note/delete/86832/in+docs
Del: other reasons-- https://master.php.net/note/delete/86832
Reject -- https://master.php.net/note/reject/86832
Search -- https://master.php.net/manage/user-notes.php