note 86832 modified in function.imagick-resizeimage by felipe

From: Date: Thu, 06 Nov 2008 20:47:54 +0000
Subject: note 86832 modified in function.imagick-resizeimage by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-146248@lists.php.net to get a copy of this message
<?php $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': <?php $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 --was-- $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 http://php.net/manual/en/function.imagick-resizeimage.php

« previous php.notes (#146248) next »