Hah, I had the exact same task a few days ago. I ended up using Graphics::Magick to resize and then DBI to insert the locations of both the thumbnail and original along with general information about the original picture. Unfortunately for you, however, this here program is not on the computer I am using.
The reason I used Graphics::Magick instead of Image::Magick is because I got tired of trying to install the latter after two days. I think the commands are the same, though. It went something like:
sub thumbnailize {
my ($pic, $thumb) = @_;
my $image = Graphics::Magick->new;
my $err;
$err = $image->Read($pic);
warn $err if $err;
$err = $image->Scale(geometry => '200x200');
warn $err if $err;
$err = $image->Write($thumb);
warn $err if $err;
}
Pretty simple after reading the documentation. :)
And you didn't even know bears could type.
|