1
0
mirror of https://github.com/Intervention/image.git synced 2025-01-17 12:18:14 +01:00

Allow animated WEBP's (#1375)

* Don't merge layers when image is animated
* Update src/Drivers/Imagick/Encoders/WebpEncoder.php

---------

Co-authored-by: Oliver Vogel <oliver@olivervogel.com>
This commit is contained in:
P.H. Knot 2024-07-05 15:35:01 +02:00 committed by GitHub
parent 115d2ad3be
commit 5451ff9f90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,10 @@ class WebpEncoder extends GenericWebpEncoder implements SpecializedInterface
$imagick = $image->core()->native();
$imagick->setImageBackgroundColor(new ImagickPixel('transparent'));
if (!$image->isAnimated()) {
$imagick = $imagick->mergeImageLayers(Imagick::LAYERMETHOD_MERGE);
}
$imagick->setFormat($format);
$imagick->setImageFormat($format);
$imagick->setCompression($compression);