Since you're not really using Perl to do anything but arrange the various *nix programs, why not use a shell script instead? It would be simpler, shorter, and wouldn't involve spawning an unnecessary interpreter.

#!/bin/bash for image in *.{gif,bmp,jpg,wmf,jpeg,png} do size=`/usr/bin/identify $image` ... [do whatever with "$size" here] ... convert -geometry 800x600 $image ${image/./-l.} convert -geometry 80x60 $image ${image/./-s.} done

...and so on. This may be just a personal quirk of mine, but I find shell scripts (or batch files) coerced into another language (whatever it happens to be) gratingly pointless.

Update: Incidentally, it fails in Linux.

ben@Tyr:/tmp/Sorayama$ ../thumbnail hajime1.jpg hajime10.jpg hajime2.jpg hajime3.jpg hajime4.jpg hajime5.jpg hajime6.jpg hajime7.jpg hajime8.jpgconverting hajime1.jpg ... convert: invalid argument for option `hajime1-l.jpgxhajime1.jpg!': -re +size. convert: invalid argument for option `hajime1-s.jpgxhajime1.jpg!': -re +size. converting hajime10.jpg ... converting hajime2.jpg ... convert: invalid argument for option `hajime2-l.jpgxhajime2.jpg!': -re +size. convert: invalid argument for option `hajime2-s.jpgxhajime2.jpg!': -re +size. converting hajime3.jpg ... convert: invalid argument for option `hajime3-l.jpgxhajime3.jpg!': -re +size. convert: invalid argument for option `hajime3-s.jpgxhajime3.jpg!': -re +size. converting hajime4.jpg ... convert: invalid argument for option `hajime4-l.jpgxhajime4.jpg!': -re +size. convert: invalid argument for option `hajime4-s.jpgxhajime4.jpg!': -re +size. converting hajime5.jpg ... convert: invalid argument for option `hajime5-l.jpgxhajime5.jpg!': -re +size. convert: invalid argument for option `hajime5-s.jpgxhajime5.jpg!': -re +size. converting hajime6.jpg ... convert: invalid argument for option `hajime6-l.jpgxhajime6.jpg!': -re +size. convert: invalid argument for option `hajime6-s.jpgxhajime6.jpg!': -re +size. converting hajime7.jpg ... converting hajime8.jpg ... convert: invalid argument for option `hajime8-l.jpgxhajime8.jpg!': -re +size. convert: invalid argument for option `hajime8-s.jpgxhajime8.jpg!': -re +size.

-- 
Human history becomes more and more a race between education and catastrophe. -- HG Wells

In reply to Re: thumbnails generator by oko1
in thread thumbnails generator by spx2

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.