I tried the Image::Magick module a while ago but never got it working. You can use ImageMagick directly though, without the module -- it comes with a bunch of utility programs. I found an old resizing script of mine that uses "mogrify.exe". Here's part of the script:
$ENV{'PATH'} = "C:\\Program Files\\imageMagick;" . $ENV{'PATH'}; # ... for my $file (@files) { $fileNumber++; my $newFile = "$largeDir\\$basename$fileNumber.JPG"; print "$fileNumber copying $file...\n"; copy("$originalDir\\$file", $newFile); open(INFO, "identify $newFile |"); my $info = <INFO>; close INFO; my ($width, $height) = ($1, $2) if ($info =~ /\s(\d+)x(\d+)\s/); my ($newWidth, $newHeight, $thumbWidth, $thumbHeight); if ($width == 1200 && $height == 1600) { ($newWidth, $newHeight) = (600, 800); ($thumbWidth, $thumbHeight) = (98, 130); } elsif ($width == 1600 && $height == 1200) { ($newWidth, $newHeight) = (800, 600); ($thumbWidth, $thumbHeight) = (130, 98); } else { ($newWidth, $newHeight) = (600, 600); ($thumbWidth, $thumbHeight) = (98, 98); } my $newDimensions = $newWidth . 'x' . $newHeight; my @command = ('mogrify', '-quality', '100', '-geometry', $newDimensions, $newFile); print "mogrifying $newFile...\n"; system(@command);
(Note: I've only used this code with a version of ImageMagick that I downloaded 4 or 5 years ago.)

-Joe


In reply to Re: How to resize picture in windows? by blahblahblah
in thread How to resize picture in windows? by gube

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.