From 356f79e99c6196f688372c70cfe1ef8810c9f227 Mon Sep 17 00:00:00 2001 From: Oliver Vogel Date: Wed, 3 Jan 2024 17:10:52 +0100 Subject: [PATCH] Adapt gif encoder api to intervention/gif v4 --- src/Drivers/Gd/Encoders/GifEncoder.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Drivers/Gd/Encoders/GifEncoder.php b/src/Drivers/Gd/Encoders/GifEncoder.php index e918a914..294dd751 100644 --- a/src/Drivers/Gd/Encoders/GifEncoder.php +++ b/src/Drivers/Gd/Encoders/GifEncoder.php @@ -27,8 +27,7 @@ class GifEncoder extends DriverSpecializedEncoder { $builder = GifBuilder::canvas( $image->width(), - $image->height(), - $image->loops() + $image->height() ); foreach ($image as $frame) { @@ -38,6 +37,8 @@ class GifEncoder extends DriverSpecializedEncoder ); } + $builder->setLoops($image->loops()); + return new EncodedImage($builder->encode(), 'image/gif'); } }