Page 1 of 1
Imagemagik problem
Posted: Wed Dec 17, 2003 10:21 am
by Jim
Code: Select all
function resize_image( $width , $height , $quality , $srcfile , $dstfile )
{
$imagemagik = "/usr/X11R6/bin";
$src_file = $srcfile;
$dest_file = $dstfile;
$qual = $quality;
$h = $height;
$w = $width;
$cmd = "{$imagemagik}/convert -quality {$qual} -geometry {$w}x{$h} $src_file $dest_file";
$do = exec($cmd);
if (!$do) { echo "This didn't work."; }
}
The function works fine - but when width and height arguments are added to the function, the height argument is ignored.
I did some checking, and both the width and height arguments are passed properly in to the function.. not sure why they aren't both being accepted though.
Any ideas anyone?
Posted: Wed Dec 17, 2003 11:56 am
by BDKR
Did you try hacking the command out at the command line? Perhaps seeing the output (if any) could give you some clue as to what's going on.
Cheers,
BDKR
Posted: Wed Dec 17, 2003 12:16 pm
by xisle
from the manual..
http://www.imagemagick.org/www/utilitie ... s-geometry
By default, the width and height are maximum values. That is, the image is expanded or contracted to fit the width and height value while maintaining the aspect ratio of the image. Append an exclamation point to the geometry to force the image size to exactly the size you specify. For example, if you specify 640x480! the image width is set to 640 pixels and height to 480.
try the exclamation point for an exact dimension.. beware of squashing...
Posted: Wed Dec 17, 2003 4:25 pm
by Jim
I love you.
Posted: Wed Dec 17, 2003 6:54 pm
by dull1554
wow aren't we thankful