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!
I tried running the script with the -x flag as suggested, and the script hung after this command:
+ '[' '!' -f ./cropped/8967-1_thumb.png ']' + convert -define jpeg:size=400x100 ./cropped/8967-1.png -thumbnail '400x100>' -background transparent -gravity center -extent 400x100 ./cropped/8967-1_thumb.png
However, when I interrupt the script and then copy and paste the command above, it runs just fine. No hanging. I can then resume the script, and it sets off again fine.