1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-08-21 07:11:24 +02:00

Added option 'shortcut, sc' to enable configuration of complex expressions. Fix #2.

This commit is contained in:
Mikael Roos
2014-11-28 16:22:24 +01:00
parent 3c04a2dd0f
commit 113b62edc0
4 changed files with 31 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
*/
/**
* Default configuration options, can be overridden in own config-file.
*
@@ -115,6 +116,25 @@ if (isset($config['default_timezone'])) {
/**
* shortcut, sc - extend arguments with a constant value, defined
* in config-file.
*/
$shortcut = get(array('shortcut', 'sc'), null);
verbose("shortcut = $shortcut");
if (isset($shortcut)
&& isset($config['shortcut'])
&& isset($config['shortcut'][$shortcut])) {
parse_str($config['shortcut'][$shortcut], $get);
verbose("shortcut-constant = {$config['shortcut'][$shortcut]}");
$_GET = array_merge($_GET, $get);
}
/**
* verbose, v - do a verbose dump of what happens
*/

View File

@@ -85,6 +85,15 @@ return array(
/**
* Create custom shortcuts for more advanced expressions.
*/
'shortcut' => array(
'sepia' => "&f=grayscale&f0=brightness,-10&f1=contrast,-20&f2=colorize,120,60,0,0&sharpen",
),
/**
* Predefined size constants.
*