mirror of
https://github.com/mosbth/cimage.git
synced 2025-09-01 03:41:43 +02:00
Added support for custom convolutions. Fix #49.
This commit is contained in:
@@ -465,19 +465,35 @@ verbose("json = $outputFormat");
|
||||
|
||||
/**
|
||||
* dpr - change to get larger image to easier support larger dpr, such as retina.
|
||||
*/
|
||||
*/
|
||||
$dpr = get(array('ppi', 'dpr', 'device-pixel-ratio'), 1);
|
||||
|
||||
verbose("dpr = $dpr");
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create the class for the image.
|
||||
*/
|
||||
require $config['cimage_class'];
|
||||
|
||||
$img = new CImage();
|
||||
$img->setVerbose($verbose);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* convolve - image convolution as in http://php.net/manual/en/function.imageconvolution.php
|
||||
*/
|
||||
$convolve = get('convolve', null);
|
||||
|
||||
verbose("convolve = $convolve");
|
||||
// Check if the convolve is matching an existing constant
|
||||
if ($convolve && isset($config['convolution_constant'])) {
|
||||
$img->addConvolveExpressions($config['convolution_constant']);
|
||||
verbose("convolve = " . print_r($config['convolution_constant'], 1));
|
||||
}
|
||||
|
||||
verbose("convolve = " . print_r($convolve, 1));
|
||||
|
||||
|
||||
|
||||
@@ -502,14 +518,10 @@ EOD;
|
||||
|
||||
|
||||
/**
|
||||
* Create and output the image
|
||||
* Load, process and output the image
|
||||
*/
|
||||
require $config['cimage_class'];
|
||||
|
||||
$img = new CImage();
|
||||
|
||||
$img->setVerbose($verbose)
|
||||
->log("Incoming arguments: " . print_r(verbose(), 1))
|
||||
$img->log("Incoming arguments: " . print_r(verbose(), 1))
|
||||
->setSource($srcImage, $config['image_path'])
|
||||
->setOptions(
|
||||
array(
|
||||
|
Reference in New Issue
Block a user