You don't check the exit status, $?, after the system call. That would tell you what the error is - it's almost surely there since you say the perl program executes without complaint. Odds are that convert (part of ImageMagick) is not installed on the server, or not in your path. Here, it's at /usr/X11R6/bin/convert.

It is good practice to use the list form of system,

my $result = system '/path/to/convert', '-geometry', "${size}x${size}", '-quality', $qual, $file, "tn_${file}"; die $? if not defined $result;
The concatenation in your example may lack needed whitespace, which the list form takes care of.

Update: If you have a lot of images it would be worthwhile to write a makefile and put the thumbnails in a subdirectory. As written, your script will write thumbnails of thumbnails each time it is run, as well as redoing work it has already done.

After Compline,
Zaxo


In reply to Re: creating thumbnails by Zaxo
in thread creating thumbnails by jwlarson3rd

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.