quality in imagemagick mode

This commit is contained in:
Shish 2011-12-24 21:28:29 +00:00
parent 5121e99dbe
commit b5f5c861c4
1 changed files with 2 additions and 2 deletions

View File

@ -94,8 +94,8 @@ class PixelFileHandler extends DataHandlerExtension {
if($size[1] > $size[0]*5) $size[1] = $size[0]*5;
// running the call with cmd.exe requires quoting for our paths
$format = '"%s" "%s[0]" -crop %ux%u +repage -flatten -strip -thumbnail %ux%u jpg:"%s"';
$cmd = sprintf($format, $convert, $inname, $size[0], $size[1], $w, $h, $outname);
$format = '"%s" "%s[0]" -crop %ux%u +repage -flatten -strip -thumbnail %ux%u -quality %u jpg:"%s"';
$cmd = sprintf($format, $convert, $inname, $size[0], $size[1], $w, $h, $q, $outname);
$cmd = str_replace("\"convert\"", "convert", $cmd); // quotes are only needed if the path to convert contains a space; some other times, quotes break things, see github bug #27
exec($cmd, $output, $ret);