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.
In reply to Re: How do I invoke ImageMagick
by Joost
in thread How do I invoke ImageMagick
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |