Support images avif si la fonction est disponible
This commit is contained in:
parent
27bb3de75c
commit
3e1aed8641
@ -1135,6 +1135,9 @@ class common
|
||||
case 'webp':
|
||||
$source_image = imagecreatefromwebp($src);
|
||||
break;
|
||||
case 'avif':
|
||||
$source_image = function_exists('imagecreatefromavif') ? imagecreatefromavif($src) : null;
|
||||
break;
|
||||
}
|
||||
// Image valide
|
||||
if ($source_image) {
|
||||
@ -1155,7 +1158,9 @@ class common
|
||||
case 'image/gif':
|
||||
return (imagegif($virtual_image, $dest));
|
||||
case 'webp':
|
||||
$source_image = imagecreatefromwebp($src);
|
||||
return (imagewebp($virtual_image, $dest));
|
||||
case 'avif':
|
||||
return (imageavif($virtual_image, $dest));
|
||||
}
|
||||
} else {
|
||||
return (false);
|
||||
|
Loading…
Reference in New Issue
Block a user