I'm trying to use the Perl Image::Magick library to use ImageMagick's thumbnail function. Everything I read suggests that ImageMagick preserves aspect ratio when it is given both a width and height, almost functioning more like max-width and max-height in CSS parlance. However, in practice, it seems to be jamming the image into the dimensions I give, disregarding aspect ratio. Am I missing a flag I need to turn on? My impression is that preserving aspect ratio is default behavior.
my $image = Image::Magick->new;
$image->BlobToImage($imageData);
$image->SetAttribute(quality => 80);
$image->SetAttribute(compression => 'JPEG');
$image->Thumbnail(width => $thumbnailWidth, height => $thumbnailHeight);