ImageMagick Perl Batch File

Posted Oct 20, 2006

I wrote this perl script to convert a large number of images using ImageMagick. I tried doing it using ImageMagick itself on the command line, but it kept going in an infinite loop.


#/usr/bin/perl

opendir(DIR,"/tmp/pics");

while ($file = readdir(DIR) )
  {
        if ($file ne "." and $file ne "..")
        {
         print " $file ";
         my $convert = `/usr/local/bin/convert -resize x450 "/tmp/pics/$file" "/tmp/pics/$file"`;
        }
   }

closedir(DIR);
exit(0);

Discussions

Comments are currently turned off

Latest Discussions

  • Carlos: Thank you!
    May 16, 2014 | Replies (0)
  • Jessica: Great info, thanks!
    May 15, 2014 | Replies (1)
  • Walter: Thanks, you totally saved me a bunch of searching around just now. I was setting up a percona xtradb...
    Feb 25, 2014 | Replies (0)
  • Avi: I've found the reason of the problem in my case. It's a bug as described here :http://bugs.mysql.com/bug.php?id=68892Shortly:...
    Dec 12, 2013 | Replies (0)
  • Avi: I've also met that behavior twice on 5.6.12 slaves. However, i didn't find the root cause of that....
    Dec 12, 2013 | Replies (0)