Why not use this line instead?:
'convert -resize 96x144 -dither -map \"$palette\" \"$file\" PNM:- | pnmtopng 2>/dev/null |'
It seems to work just as well, and it uses one less command (djpeg) and allows for filenames with spaces. What I could not find is the way to generate the correct kind of PNG file directly with convert, without the need for pnmtopng.
|