Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

How can I re-size an uploaded image with Perl? And is it possible to get the original height and width values of the uploaded image so I can re-size it proportionally?

Thanks,
Ralph.

Replies are listed 'Best First'.
Re: Manipulating Images with Perl
by gjb (Vicar) on Nov 02, 2002 at 15:26 UTC

    PerlMagick, a Perl module to access ImageMagick's functionality from Perl should do all you want (and probably much more ;-)

    Hope this helps, -gjb-

Re: Manipulating Images with Perl
by valdez (Monsignor) on Nov 02, 2002 at 15:36 UTC

    I answered a question like this few days ago, please read node 209268 for code. There many modules that can deal with images on CPAN; the example I wrote uses GD and Image::Magick (part of PerlMagick mentioned by gjb).

    Ciao, Valerio

Re: Manipulating Images with Perl
by rcaputo (Chaplain) on Nov 02, 2002 at 23:25 UTC
Re: Manipulating Images with Perl
by JupiterCrash (Monk) on Nov 02, 2002 at 16:25 UTC
    This isn't the fanciest of ways, but it does the job easily without needing any new Perl modules. Just install ImageMagick, and then use its "mogrify" command-line utility from Perl:
    system("mogrify -quality 50 -geometry 80x80 *.JPG");