Lossless encoding for WebP and PHP 8.1+

This commit is contained in:
Visman 2023-03-29 00:14:15 +07:00
parent 70e01c4f79
commit 1cf72c4706

View file

@ -71,6 +71,9 @@ class GDDriver extends DefaultDriver
case 'jpg':
$type = 'jpeg';
case 'webp':
if (defined('\\IMG_WEBP_LOSSLESS')) {
$quality = \IMG_WEBP_LOSSLESS; // кодирование без потери качества
}
case 'avif':
$args[] = $quality;
break;