summaryrefslogtreecommitdiff
path: root/lib/exe/fetch.php
diff options
context:
space:
mode:
authorBen Coburn <btcoburn@silicodon.net>2006-05-16 08:23:21 +0200
committerBen Coburn <btcoburn@silicodon.net>2006-05-16 08:23:21 +0200
commit2b03e74de514af15d4004e7635625fa64816231a (patch)
treee1d60964b029476328279d9bf0f7f4e83068d74c /lib/exe/fetch.php
parentdb1fc0df0c64ca0e16140e9be6d15815cdefc767 (diff)
downloadrpg-2b03e74de514af15d4004e7635625fa64816231a.tar.gz
rpg-2b03e74de514af15d4004e7635625fa64816231a.tar.bz2
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
Diffstat (limited to 'lib/exe/fetch.php')
-rw-r--r--lib/exe/fetch.php5
1 files changed, 4 insertions, 1 deletions
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')){