in reply to shrink.pl - Scales down images
And then let $size be either "50%" or "72" at the top there. The former will make a half-size picture. The latter will make the largest image that fits into 72x72, while keeping the proportions, as all your code attempts to do.... main code ... $size = "${size}x$size" unless $size =~ /%$/; ... sub shrink { my $name = shift; my $img = Image::Magick->new; $img->Read($name); $img->Mogrify('geometry' => $size); $img->Write($name); }
Yeah, the ImageMagick docs are a real pain to get into, but once you've got the good tricks, it's rather nice.
-- Randal L. Schwartz, Perl hacker
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: shrink.pl - Scales down images
by Vortacist (Pilgrim) on Jan 22, 2001 at 01:51 UTC | |
by merlyn (Sage) on Jan 22, 2001 at 06:12 UTC |