diff --git a/src/Drivers/Gd/Encoders/WebpEncoder.php b/src/Drivers/Gd/Encoders/WebpEncoder.php index d6a1ef76..23939a3c 100644 --- a/src/Drivers/Gd/Encoders/WebpEncoder.php +++ b/src/Drivers/Gd/Encoders/WebpEncoder.php @@ -13,9 +13,8 @@ class WebpEncoder extends DriverSpecializedEncoder { public function encode(ImageInterface $image): EncodedImage { - $gd = $image->core()->native(); - $data = $this->getBuffered(function () use ($gd) { - imagewebp($gd, null, $this->quality); + $data = $this->getBuffered(function () use ($image) { + imagewebp($image->core()->native(), null, $this->quality); }); return new EncodedImage($data, 'image/webp');