http://qs321.pair.com?node_id=11138304


in reply to graphicsmagick perl shrink image to size

I gave up using Image Magick in favour of Imager. If you have a look at the scale() function on the Imager::Transformations page you will see how easy it is to accomplish.
my $newimg = $img->scale( xpixels => 800, ypixels => 200, type => 'min', );
Obviously you only need to do this transform if the original image exceeds one of the dimensions.