mirror of
https://github.com/Intervention/image.git
synced 2025-09-01 18:02:45 +02:00
Refactor code
This commit is contained in:
@@ -13,9 +13,8 @@ class WebpEncoder extends DriverSpecializedEncoder
|
|||||||
{
|
{
|
||||||
public function encode(ImageInterface $image): EncodedImage
|
public function encode(ImageInterface $image): EncodedImage
|
||||||
{
|
{
|
||||||
$gd = $image->core()->native();
|
$data = $this->getBuffered(function () use ($image) {
|
||||||
$data = $this->getBuffered(function () use ($gd) {
|
imagewebp($image->core()->native(), null, $this->quality);
|
||||||
imagewebp($gd, null, $this->quality);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return new EncodedImage($data, 'image/webp');
|
return new EncodedImage($data, 'image/webp');
|
||||||
|
Reference in New Issue
Block a user