protected function GaussianBlur::execute in Image Effects 8.2
Same name in this branch
- 8.2 src/Plugin/ImageToolkit/Operation/gd/GaussianBlur.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\gd\GaussianBlur::execute()
- 8.2 src/Plugin/ImageToolkit/Operation/imagemagick/GaussianBlur.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\imagemagick\GaussianBlur::execute()
Same name and namespace in other branches
- 8.3 src/Plugin/ImageToolkit/Operation/imagemagick/GaussianBlur.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\imagemagick\GaussianBlur::execute()
- 8 src/Plugin/ImageToolkit/Operation/imagemagick/GaussianBlur.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\imagemagick\GaussianBlur::execute()
File
- src/
Plugin/ ImageToolkit/ Operation/ imagemagick/ GaussianBlur.php, line 26
Class
- GaussianBlur
- Defines ImageMagick Gaussian Blur operation.
Namespace
Drupal\image_effects\Plugin\ImageToolkit\Operation\imagemagickCode
protected function execute(array $arguments) {
switch ($this
->getToolkit()
->getExecManager()
->getPackage()) {
case 'imagemagick':
$op = '-channel RGBA -blur ' . $arguments['radius'];
break;
case 'graphicsmagick':
$op = '-gaussian ' . $arguments['radius'];
break;
}
$sigma = $arguments['sigma'] !== NULL ? $arguments['sigma'] : $arguments['radius'] / 3 * 2;
$op .= 'x' . number_format($sigma, 1, '.', '');
$this
->addArgument($op);
return TRUE;
}