summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/dokuwiki.php1
-rw-r--r--lib/exe/fetch.php5
-rw-r--r--lib/plugins/config/lang/en/lang.php2
-rw-r--r--lib/plugins/config/settings/config.metadata.php7
4 files changed, 12 insertions, 3 deletions
diff --git a/conf/dokuwiki.php b/conf/dokuwiki.php
index 7d70838da..d1fc851fd 100644
--- a/conf/dokuwiki.php
+++ b/conf/dokuwiki.php
@@ -78,6 +78,7 @@ $conf['notify'] = ''; //send change info to this email (leave
$conf['mailfrom'] = ''; //use this email when sending mails
$conf['gdlib'] = 2; //the GDlib version (0, 1 or 2) 2 tries to autodetect
$conf['im_convert'] = ''; //path to ImageMagicks convert (will be used instead of GD)
+$conf['jpg_quality'] = '70'; //quality of compression when scaling jpg images (0-100)
$conf['spellchecker']= 0; //enable Spellchecker (needs PHP >= 4.3.0 and aspell installed)
$conf['subscribers'] = 0; //enable change notice subscription support
$conf['compress'] = 1; //Strip whitespaces and comments from Styles and JavaScript? 1|0
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')){
diff --git a/lib/plugins/config/lang/en/lang.php b/lib/plugins/config/lang/en/lang.php
index a19a71d0d..b41402072 100644
--- a/lib/plugins/config/lang/en/lang.php
+++ b/lib/plugins/config/lang/en/lang.php
@@ -30,6 +30,7 @@ $lang['_authentication'] = 'Authentication Settings';
$lang['_anti_spam'] = 'Anti-Spam Settings';
$lang['_editing'] = 'Editing Settings';
$lang['_links'] = 'Link Settings';
+$lang['_media'] = 'Media Settings';
$lang['_advanced'] = 'Advanced Settings';
$lang['_network'] = 'Network Settings';
// The settings group name for plugins and templates can be set with
@@ -100,6 +101,7 @@ $lang['notify'] = 'Send change notifications to this email address';
$lang['mailfrom'] = 'Email address to use for automatic mails';
$lang['gdlib'] = 'GD Lib version';
$lang['im_convert'] = 'Path to ImageMagick\'s convert tool';
+$lang['jpg_quality'] = 'JPG compression quality (0-100)';
$lang['spellchecker']= 'Enable spellchecker';
$lang['subscribers'] = 'Enable page subscription support';
$lang['compress'] = 'Compress CSS and javascript files';
diff --git a/lib/plugins/config/settings/config.metadata.php b/lib/plugins/config/settings/config.metadata.php
index bf2b74ff5..d48d08d56 100644
--- a/lib/plugins/config/settings/config.metadata.php
+++ b/lib/plugins/config/settings/config.metadata.php
@@ -133,6 +133,11 @@ $meta['target____extern'] = array('string');
$meta['target____media'] = array('string');
$meta['target____windows'] = array('string');
+$meta['_media'] = array('fieldset');
+$meta['gdlib'] = array('multichoice','_choices' => array(0,1,2));
+$meta['im_convert'] = array('im_convert');
+$meta['jpg_quality'] = array('numeric','_pattern' => '/^100$|^[1-9]?[0-9]$/'); //(0-100)
+
$meta['_advanced'] = array('fieldset');
$meta['userewrite'] = array('multichoice','_choices' => array(0,1,2));
$meta['useslash'] = array('onoff');
@@ -141,8 +146,6 @@ $meta['canonical'] = array('onoff');
$meta['autoplural'] = array('onoff');
$meta['usegzip'] = array('onoff');
$meta['mailfrom'] = array('email');
-$meta['gdlib'] = array('multichoice','_choices' => array(0,1,2));
-$meta['im_convert'] = array('im_convert');
$meta['compress'] = array('onoff');
$meta['hidepages'] = array('string');
$meta['send404'] = array('onoff');