You are here

public function AddWatermarkEffect::applyEffect in Basic Watermark 8

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/AddWatermarkEffect.php, line 23

Class

AddWatermarkEffect
Converts an image resource.

Namespace

Drupal\basic_watermark\Plugin\ImageEffect

Code

public function applyEffect(ImageInterface $image) {
  $result = $image
    ->apply('add_watermark', $this->configuration);
  if (!$result) {
    return FALSE;
  }
  return TRUE;
}