(ImageMagick seems to output all the PNGs on stdout in order, so we just
do another convert pass, which removes all but the first.)
# Make a thumbnail from the finished PDF, for later reference. (Output to
# stdout is so we make sure we get only the first page; it's the simplest
# hack I can find offhand. :-) )
# Make a thumbnail from the finished PDF, for later reference. (Output to
# stdout is so we make sure we get only the first page; it's the simplest
# hack I can find offhand. :-) )
- system("convert -resize 192x192 output/$pdf_filename png:- > output/$pdf_filename.png");
+ system("convert -resize 192x192 output/$pdf_filename png:- | convert png:- png:- > output/$pdf_filename.png");
open DESC, ">output/$pdf_filename.desc";
if ($url =~ /^http/i) {
open DESC, ">output/$pdf_filename.desc";
if ($url =~ /^http/i) {