You are here

public function ImageStyleQualityImageEffect::applyEffect in Image Style Quality 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/ImageStyleQualityImageEffect.php, line 40

Class

ImageStyleQualityImageEffect
Allows you to change the quality of an image, per image style.

Namespace

Drupal\image_style_quality\Plugin\ImageEffect

Code

public function applyEffect(ImageInterface $image) {
  $this->configFactory
    ->get($this->mutableQualityToolkit['config_object'])
    ->setModuleOverride([
    $this->mutableQualityToolkit['config_key'] => $this->configuration['quality'],
  ]);
}