I'm trying to port an image effect from D7 to D8.
I've got Drupal to list the plugin, but when I try to use it I get a WSOD with "Fatal error: Cannot redeclare class Drupal\image\Plugin\ImageEffect\EffectMagic".
I've checked and there is no other declaration of this class anywhere.
My file is in mymod/src/Plugin/ImageEffect/EffectMagic.php
and it looks like this (nb. content of functions is removed)
/**
* @file
* Contains \Drupal\image\Plugin\ImageEffect\EffectMagic.
*/
namespace Drupal\image\Plugin\ImageEffect;
use Drupal\Core\Image\ImageInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\image\ConfigurableImageEffectBase;
/**
* Scales and crops an image resource.
*
* @ImageEffect(
* id = "image_effect_magic",
* label = @Translation("Effect Magic"),
* description = @Translation("Use ImageMagic command line to process images.")
* )
*/
class EffectMagic extends ConfigurableImageEffectBase {
public function buildConfigurationForm(array $form, FormStateInterface $form_state)
public function validateConfigurationForm(array &$form, FormStateInterface $form_state)
public function submitConfigurationForm(array &$form, FormStateInterface $form_state)
public function applyEffect(ImageInterface $image)
public function transformDimensions(array &$dimensions, $uri)
public function getSummary()
public function defaultConfiguration()
}
namespace Drupal\mymod\Plugin\ImageEffect;