mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-01 20:04:51 +02:00
Fixes #2036 WebP support when using PHP GD
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user