TransparentBackgroundEffect.php in Imagick 8
File
src/Plugin/ImageEffect/TransparentBackgroundEffect.php
View source
<?php
namespace Drupal\imagick\Plugin\ImageEffect;
use Drupal\Core\Image\ImageInterface;
use Drupal\image\ImageEffectBase;
class TransparentBackgroundEffect extends ImageEffectBase {
public function applyEffect(ImageInterface $image) {
if (!$image
->apply('transparent_background', $this->configuration)) {
$this->logger
->error('Image transparent background failed using the %toolkit toolkit on %path (%mimetype)', [
'%toolkit' => $image
->getToolkitId(),
'%path' => $image
->getSource(),
'%mimetype' => $image
->getMimeType(),
]);
return FALSE;
}
return TRUE;
}
}