diff --git a/admin/include/image.class.php b/admin/include/image.class.php index 67718acf2..e583185e0 100644 --- a/admin/include/image.class.php +++ b/admin/include/image.class.php @@ -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);