mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-05 07:37:37 +02:00
Added configuration for default jpeg quality and png compression in the config file, #107.
This commit is contained in:
@@ -8,8 +8,10 @@ Revision history
|
||||
v0.7.6* (2015-10-20)
|
||||
-------------------------------------
|
||||
|
||||
* Added configuration for default jpeg quality and png compression in the config file, #107.
|
||||
* Strip comments and whitespace in imgs.php, #115.
|
||||
* Bundle imgs.php did not have the correct mode.
|
||||
* Adding option &status to get an overview of the installed ond configured utilities, #116.
|
||||
* Adding option &status to get an overview of the installed on configured utilities, #116.
|
||||
* Bug, all files saved as png-files, when not saving as specific file.
|
||||
* Removed saving filename extension for alias images.
|
||||
* Added option to decide if resample or resize when copying images internally. `&no-resample` makes resize, instead of resample as is default.
|
||||
|
@@ -649,11 +649,16 @@ verbose("use cache = $useCache");
|
||||
* quality, q - set level of quality for jpeg images
|
||||
*/
|
||||
$quality = get(array('quality', 'q'));
|
||||
$qualityDefault = getConfig('jpg_quality', null);
|
||||
|
||||
is_null($quality)
|
||||
or ($quality > 0 and $quality <= 100)
|
||||
or errorPage('Quality out of range');
|
||||
|
||||
if (is_null($quality) && !is_null($qualityDefault)) {
|
||||
$quality = $qualityDefault;
|
||||
}
|
||||
|
||||
verbose("quality = $quality");
|
||||
|
||||
|
||||
@@ -662,12 +667,16 @@ verbose("quality = $quality");
|
||||
* compress, co - what strategy to use when compressing png images
|
||||
*/
|
||||
$compress = get(array('compress', 'co'));
|
||||
|
||||
$compressDefault = getConfig('png_compression', null);
|
||||
|
||||
is_null($compress)
|
||||
or ($compress > 0 and $compress <= 9)
|
||||
or errorPage('Compress out of range');
|
||||
|
||||
if (is_null($compress) && !is_null($compressDefault)) {
|
||||
$compress = $compressDefault;
|
||||
}
|
||||
|
||||
verbose("compress = $compress");
|
||||
|
||||
|
||||
|
@@ -109,6 +109,19 @@ return array(
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Change the default values for CImage quality and compression used
|
||||
* when saving images.
|
||||
*
|
||||
* Default value:
|
||||
* jpg_quality: null, integer between 0-100
|
||||
* png_compression: null, integer between 0-9
|
||||
*/
|
||||
//'jpg_quality' => 75,
|
||||
//'png_compression' => 1,
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The name representing a dummy image which is automatically created
|
||||
* and stored at the defined path. The dummy image can then be used
|
||||
|
Reference in New Issue
Block a user