From fb163aa5c848f278758e694b99b65c2b3af16e19 Mon Sep 17 00:00:00 2001 From: jacques Date: Wed, 19 Feb 2014 11:33:54 +0100 Subject: [PATCH] Ghostscript au lieu de convert. --- chant_img.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 chant_img.php diff --git a/chant_img.php b/chant_img.php old mode 100644 new mode 100755 index 29b18ff..56a9cd5 --- a/chant_img.php +++ b/chant_img.php @@ -177,9 +177,11 @@ function makeimgfiles($id, $tex, $suffix = '') { fclose($f[0]); chdir(dirname($f[1])); exec('lualatex --interaction=nonstopmode '.basename($f[1])); - exec('convert -density 300 '.substr($f[1],0,-4).'.pdf -flatten -trim '.$path.'png/'.$id.$suffix.'.png'); +# exec('convert -density 300 '.substr($f[1],0,-4).'.pdf -flatten -trim '.$path.'png/'.$id.$suffix.'.png'); + exec('gs -q -dBATCH -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=pnggray -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r300x300 -sOutputFile='.$path.'png/'.$id.$suffix.'.png -- '.substr($f[1],0,-4).'.pdf -c quit'); chmod($path.'png/'.$id.$suffix.'.png', 0666); - exec('convert -resize 33.333333% '.$path.'png/'.$id.$suffix.'.png '.$path.$id.$suffix.'.png'); +# exec('convert -resize 33.333333% '.$path.'png/'.$id.$suffix.'.png '.$path.$id.$suffix.'.png'); + exec('gs -q -dBATCH -dMaxBitmap=50000000 -dNOPAUSE -sDEVICE=pnggray -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r100x100 -sOutputFile='.$path.$id.$suffix.'.png -- '.substr($f[1],0,-4).'.pdf -c quit'); chmod($path.$id.$suffix.'.png', 0666); exec('pdfcrop '.substr($f[1],0,-4).'.pdf '.$path.'pdf/'.$id.$suffix.'.pdf'); chmod($path.'pdf/'.$id.$suffix.'.pdf', 0666);