diff --git a/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php index 6da7a6f..5619535 100644 --- a/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php +++ b/core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php @@ -244,7 +244,12 @@ public function save($destination) { imagealphablending($this->getResource(), FALSE); imagesavealpha($this->getResource(), TRUE); } - $success = $function($this->getResource(), $destination); + if ($function === 'imagewebp') { + $success = $function($this->getResource(), $destination, 100); + } + else { + $success = $function($this->getResource(), $destination); + } } // Move temporary local file to remote destination. if (isset($permanent_destination) && $success) { diff --git a/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php index 2fae80f..128b606 100644 --- a/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php +++ b/core/tests/Drupal/KernelTests/Core/Image/ToolkitGdTest.php @@ -78,7 +78,7 @@ protected function buildWebpTestImage() { imagefilledrectangle($res, 20, 10, 39, 19, $blue); imagefilledrectangle($res, 0, 10, 19, 19, $yellow_transparent); imagesavealpha($res, TRUE); - imagewebp($res, Settings::get('file_public_path') . '/sourceimagetest/img-test.webp'); + imagewebp($res, Settings::get('file_public_path') . '/sourceimagetest/img-test.webp', 100); } /**