use strict; use warnings; use Image::Magick; use File::Spec::Functions qw(splitpath); my $thumbX = 100; my $thumbY = 66; my $filename = shift; my $image = Image::Magick->new (); $image->ReadImage ($filename); my ($height, $width) = $image->Get ('height', 'width'); my ($x, $y) = $height < $width ? ($thumbX, $thumbY) : ($thumbY, $thumb +X); my ($drive, $dir, $file) = splitpath ($filename); $file =~ s/(\..*?)$/_s$1/; $image->Thumbnail (width=>$x, height=>$y); $image->Write ("$drive${dir}$file");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Generate small .jpeg file thumbnails using Image Magick
by b10m (Vicar) on Sep 28, 2005 at 11:04 UTC | |
by GrandFather (Saint) on Sep 28, 2005 at 11:11 UTC |