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; break;
case 'jpg': case 'jpg':
$type = 'jpeg'; $type = 'jpeg';
// $args[] = $quality; $args[] = $quality;
// break; break;
case 'webp': case 'webp':
// if (defined('\\IMG_WEBP_LOSSLESS')) {
// $quality = \IMG_WEBP_LOSSLESS; // кодирование без потери качества
// }
case 'avif': case 'avif':
if (\imagecolorstotal($image) > 0) {
\imagepalettetotruecolor($image);
$args = [$this->tuning($image), $path];
}
$args[] = $quality; $args[] = $quality;
break; break;
default: default: