in reply to How do I invoke ImageMagick
my ($w,$h) = (`identify '$indir/$_'` =~ /(\d+)x(\d+)/); my $resize = ($w > $h ? "168x118" : "118x168"); system("convert -size $resize -resize $resize '$indir/$_' '$outdir/$ou +tfile-small.jpg'") == 0 or die "Error converting";
Using the Image::Magick module will probably make your code a bit cleaner than this, though.
|
|---|