From 2b03e74de514af15d4004e7635625fa64816231a Mon Sep 17 00:00:00 2001 From: Ben Coburn Date: Tue, 16 May 2006 08:23:21 +0200 Subject: jpg quality option - Adds a jpg quality setting for scaled images (Some images were getting too many jpg artifacts at the hard-coded compression setting.) - Creates a group for the media settings in the config plugin. darcs-hash:20060516062321-05dcb-a175b0de3264322a335cf60d8ee96317f7b03144.gz --- lib/exe/fetch.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/exe/fetch.php') diff --git a/lib/exe/fetch.php b/lib/exe/fetch.php index 4df204f50..7f5024b2d 100644 --- a/lib/exe/fetch.php +++ b/lib/exe/fetch.php @@ -262,6 +262,9 @@ function resize_imageIM($ext,$from,$from_w,$from_h,$to,$to_w,$to_h){ // prepare command $cmd = $conf['im_convert']; $cmd .= ' -resize '.$to_w.'x'.$to_h.'!'; + if ($ext == 'jpg' || $ext == 'jpeg') { + $cmd .= ' -quality '.$conf['jpg_quality']; + } $cmd .= " $from $to"; @exec($cmd,$out,$retval); @@ -328,7 +331,7 @@ function resize_imageGD($ext,$from,$from_w,$from_h,$to,$to_w,$to_h){ if(!function_exists('imagejpeg')){ $okay = false; }else{ - $okay = imagejpeg($newimg, $to, 70); + $okay = imagejpeg($newimg, $to, $conf['jpg_quality']); } }elseif($ext == 'png') { if(!function_exists('imagepng')){ -- cgit v1.2.3