mirror of
https://github.com/Intervention/image.git
synced 2025-01-29 09:47:36 +01:00
Check for existance of IMG_WEBP_LOSSLESS constant
Constant is only presnet, if the used libgd supports lossless WebP encoding.
This commit is contained in:
parent
14a7b5b24f
commit
4476d9414f
@ -18,7 +18,7 @@ class WebpEncoder extends GenericWebpEncoder implements SpecializedInterface
|
||||
*/
|
||||
public function encode(ImageInterface $image): EncodedImage
|
||||
{
|
||||
$quality = $this->quality === 100 ? IMG_WEBP_LOSSLESS : $this->quality;
|
||||
$quality = $this->quality === 100 && defined('IMG_WEBP_LOSSLESS') ? IMG_WEBP_LOSSLESS : $this->quality;
|
||||
|
||||
return $this->createEncodedImage(function ($pointer) use ($image, $quality): void {
|
||||
imagewebp($image->core()->native(), $pointer, $quality);
|
||||
|
Loading…
x
Reference in New Issue
Block a user