Skip to content
Snippets Groups Projects
Commit bfd658c8 authored by Michael Lander's avatar Michael Lander
Browse files

Added support for 10.3 & 11

parent 4eafdde3
No related branches found
No related tags found
No related merge requests found
name: 'ImageAPI Optimize WebP Responsive'
type: module
description: 'Implements WebP derivatives in core Responsive Images'
core: 8.x
core_version_requirement: ^8 || ^9 || ^10
core_version_requirement: ^10.3 || ^11
package: 'Image Optimize'
dependencies:
- imageapi_optimize_webp:imageapi_optimize_webp
......@@ -3,7 +3,7 @@
namespace Drupal\imageapi_optimize_webp\Entity;
use Drupal\imageapi_optimize\Entity\ImageAPIOptimizePipeline;
use Drupal\Core\File\FileSystemInterface;
use Drupal\Core\File\FileExists;
/**
* Wrap ImageAPIOptimizePipeline to copy webp derivative to proper directory.
......@@ -34,7 +34,7 @@ class ImageAPIOptimizeWebPPipeline extends ImageAPIOptimizePipeline {
foreach ($this->temporaryFiles as $temp_image_uri) {
$temp_webp_uri = $temp_image_uri . '.webp';
if (file_exists($temp_webp_uri)) {
$temp_image_uri = \Drupal::service('file_system')->copy($temp_webp_uri, $webp_uri, FileSystemInterface::EXISTS_RENAME);
$temp_image_uri = \Drupal::service('file_system')->copy($temp_webp_uri, $webp_uri, FileExists::Rename);
if ($temp_image_uri) {
$this->temporaryFiles[] = $temp_webp_uri;
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment