mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-04 07:07:32 +02:00
Added option 'shortcut, sc' to enable configuration of complex expressions. Fix #2.
This commit is contained in:
@@ -1227,7 +1227,7 @@ class CImage
|
|||||||
if (isset($this->filters) && is_array($this->filters)) {
|
if (isset($this->filters) && is_array($this->filters)) {
|
||||||
|
|
||||||
foreach ($this->filters as $filter) {
|
foreach ($this->filters as $filter) {
|
||||||
$this->log("Applying filter $filter.");
|
$this->log("Applying filter {$filter['type']}.");
|
||||||
|
|
||||||
switch ($filter['argc']) {
|
switch ($filter['argc']) {
|
||||||
|
|
||||||
|
@@ -133,6 +133,7 @@ Revision history
|
|||||||
|
|
||||||
v0.5.x (latest)
|
v0.5.x (latest)
|
||||||
|
|
||||||
|
* Added option `shortcut, sc` to enable configuration of complex expressions. Fix 2.
|
||||||
* Added support for custom convolutions. Fix #49.
|
* Added support for custom convolutions. Fix #49.
|
||||||
* Restructured testprograms. Fix #41.
|
* Restructured testprograms. Fix #41.
|
||||||
* Corrected json on PHP 5.3. Fix #42.
|
* Corrected json on PHP 5.3. Fix #42.
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default configuration options, can be overridden in own config-file.
|
* 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
|
* 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.
|
* Predefined size constants.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user