You are here

public function Webp::applyToImage in WebP 8

File

src/Plugin/ImageAPIOptimizeProcessor/Webp.php, line 22

Class

Webp
Saves a WebP copy of an image style derivative.

Namespace

Drupal\webp\Plugin\ImageAPIOptimizeProcessor

Code

public function applyToImage($image_uri) {

  /* @var \Drupal\webp\Webp $webp */
  $webp = \Drupal::service('webp.webp');
  $webp
    ->createWebpCopy($image_uri, $this->configuration['quality']);
}