/**
  * {@inheritdoc}
  */
 protected function prepareImageEffect($image_effect)
 {
     $image_effect = $this->effectManager->createInstance($image_effect);
     // Set the initial weight so this effect comes last.
     $image_effect->setWeight(count($this->imageStyle->getEffects()));
     return $image_effect;
 }
Example #2
0
 /**
  * Asserts the effect processing of an image effect plugin.
  *
  * @param string $effect_name
  *   The name of the image effect to test.
  * @param array $data
  *   The data to pass to the image effect.
  *
  * @return bool
  *   TRUE if the assertion succeeded, FALSE otherwise.
  */
 protected function assertImageEffect($effect_name, array $data)
 {
     $effect = $this->manager->createInstance($effect_name, array('data' => $data));
     return $this->assertTrue($effect->applyEffect($this->image), 'Function returned the expected value.');
 }