Fix for GD

1. Palette image not supported by webp
2. imageavif(): avif error - avif doesn't support palette images
This commit is contained in:
Visman 2023-07-12 18:18:26 +07:00
parent 9d0ec76e8b
commit f40f76f0c6

View file

@ -90,13 +90,16 @@ class GDDriver extends DefaultDriver
break;
case 'jpg':
$type = 'jpeg';
// $args[] = $quality;
// break;
$args[] = $quality;
break;
case 'webp':
// if (defined('\\IMG_WEBP_LOSSLESS')) {
// $quality = \IMG_WEBP_LOSSLESS; // кодирование без потери качества
// }
case 'avif':
if (\imagecolorstotal($image) > 0) {
\imagepalettetotruecolor($image);
$args = [$this->tuning($image), $path];
}
$args[] = $quality;
break;
default: