From: Steinar H. Gunderson Date: Tue, 9 Aug 2005 17:52:09 +0000 (+0000) Subject: Added another minor hack for making sure we only get the first page in the PNG. X-Git-Url: https://git.sesse.net/?p=webpdf;a=commitdiff_plain;h=aebae0c5041d1d7a2c97c5711b36b7688b6f6442 Added another minor hack for making sure we only get the first page in the PNG. (ImageMagick seems to output all the PNGs on stdout in order, so we just do another convert pass, which removes all but the first.) --- diff --git a/createpdf.pl b/createpdf.pl index 1af0b87..e74ab0e 100755 --- a/createpdf.pl +++ b/createpdf.pl @@ -159,7 +159,7 @@ if (defined($size) && $size > 0) { # 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) {