in reply to Creating thumbnails

In one of my sites I have been using the following function for a while (uses Image::Magick):
use Carp; use Image::Magick; ... # makethumbnail( jpeg-data ) # creates a thumbnail with maximum size 120x120 sub makethumbnail { my $data = shift; my $image=Image::Magick->new(magick=>'JPEG'); my $res; $res = $image->BlobToImage($data); if ($res) { carp("makethumbnail: Error reading image - $res\n"); return undef; } $res = $image->Transform(geometry=>'120x120'); if ($res) { $res = $image->Resize(geometry=>'120x120'); if ($res) { carp("makethumbnail: Error while resizing: $res\n"); return undef; } } my @blob = $image->ImageToBlob(); if ($#blob!=0) { carp("makethumbnail: Error while converting to blob\n"); return undef; } return $blob[0]; }

I seem to recall that the double command for resizing depends on the interface changing at some point.

Cheers
Antonio

Update: I hadn't read the original post carefully enough. Of course you were asking for a non-Image::Magick solution. Hopefully someone will find this helpful anyway.

The stupider the astronaut, the easier it is to win the trip to Vega - A. Tucket