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:
@@ -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
|
||||
*/
|
||||
|
@@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user