1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-30 09:10:21 +02:00

Refactor code

This commit is contained in:
Oliver Vogel
2023-12-19 16:36:32 +01:00
parent 2d0369b3a9
commit a1da8e287a

View File

@@ -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');