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;
|
||||
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:
|
||||
|
|
Loading…
Reference in a new issue