Fixes #2036 WebP support when using PHP GD

This commit is contained in:
David
2026-04-29 21:50:12 +02:00
committed by Pierrick Le Gall
parent 01f68b81c6
commit 1b1c89867e
+8
View File
@@ -786,6 +786,10 @@ class image_gd implements imageInterface
{
$this->image = imagecreatefromgif($source_filepath);
}
elseif ($extension == 'webp' and $gd_info['WebP Support'])
{
$this->image = imagecreatefromwebp($source_filepath);
}
else
{
die('[Image GD] unsupported file extension');
@@ -911,6 +915,10 @@ class image_gd implements imageInterface
{
imagegif($this->image, $destination_filepath);
}
elseif ($extension == 'webp')
{
imagewebp($this->image, $destination_filepath, $this->quality);
}
else
{
imagejpeg($this->image, $destination_filepath, $this->quality);