public function ImagemagickArgumentsImageEffect::applyEffect in Image Effects 8.3
Same name and namespace in other branches
- 8 src/Plugin/ImageEffect/ImagemagickArgumentsImageEffect.php \Drupal\image_effects\Plugin\ImageEffect\ImagemagickArgumentsImageEffect::applyEffect()
- 8.2 src/Plugin/ImageEffect/ImagemagickArgumentsImageEffect.php \Drupal\image_effects\Plugin\ImageEffect\ImagemagickArgumentsImageEffect::applyEffect()
Applies an image effect to the image object.
Parameters
\Drupal\Core\Image\ImageInterface $image: An image file object.
Return value
bool TRUE on success. FALSE if unable to perform the image effect on the image.
Overrides ImageEffectInterface::applyEffect
File
- src/
Plugin/ ImageEffect/ ImagemagickArgumentsImageEffect.php, line 112
Class
- ImagemagickArgumentsImageEffect
- Class ImagemagickArgumentsImageEffect.
Namespace
Drupal\image_effects\Plugin\ImageEffectCode
public function applyEffect(ImageInterface $image) {
// Get resulting dimensions.
$d = $this
->getDimensions($image
->getWidth(), $image
->getHeight());
return $image
->apply('imagemagick_arguments', [
'command_line' => str_replace([
"\r",
"\n",
], ' ', $this->configuration['command_line']),
'width' => $d['width'],
'height' => $d['height'],
]);
}