You are here

public function FocalPointEffectBase::applyEffect in Focal Point 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 ResizeImageEffect::applyEffect

2 calls to FocalPointEffectBase::applyEffect()
FocalPointCropImageEffect::applyEffect in src/Plugin/ImageEffect/FocalPointCropImageEffect.php
@codeCoverageIgnore
FocalPointScaleAndCropImageEffect::applyEffect in src/Plugin/ImageEffect/FocalPointScaleAndCropImageEffect.php
Applies an image effect to the image object.
2 methods override FocalPointEffectBase::applyEffect()
FocalPointCropImageEffect::applyEffect in src/Plugin/ImageEffect/FocalPointCropImageEffect.php
@codeCoverageIgnore
FocalPointScaleAndCropImageEffect::applyEffect in src/Plugin/ImageEffect/FocalPointScaleAndCropImageEffect.php
Applies an image effect to the image object.

File

src/FocalPointEffectBase.php, line 105

Class

FocalPointEffectBase
Provides a base class for image effects.

Namespace

Drupal\focal_point

Code

public function applyEffect(ImageInterface $image) {

  // @todo: Get the original image in case there are multiple scale/crop effects?
  $this
    ->setOriginalImageSize($image
    ->getWidth(), $image
    ->getHeight());
  return TRUE;
}