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:
parent
9d0ec76e8b
commit
f40f76f0c6
1 changed files with 8 additions and 5 deletions
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue