Shell script with ImageMagick: hangs forever?

Posted by AP257 on Super User See other posts from Super User or by AP257
Published on 2010-12-29T13:45:04Z Indexed on 2010/12/29 13:55 UTC
Read the original article Hit count: 321

Filed under:
|
|
|

I've generated a shell script that uses ImageMagick to convert and crop around 18000 images. Here's a sample entry (so there are 18000 of these):

if [ ! -f ./cropped/16333-1.png ]
then
convert -crop 724x118+876+1989 ./lin/34.png ./cropped/16333-1.png
echo cropping 16333-1
fi
if [ ! -f ./cropped/16333-1_thumb.png ]
then
convert -define jpeg:size=400x100 ./cropped/16333-1.png -thumbnail '400x100>' -background transparent -gravity center -extent 400x100 ./cropped/16333-1_thumb.png
echo thumbing 16333-1
fi

The script only runs for about 2000 images before hanging forever. Am I missing something, or leaking memory somewhere?

Thanks for your help!

© Super User or respective owner

Related posts about bash

Related posts about shell