imagewebp
Intervention/image
Supported Versions: PHP 5 >= 5.4.0, PHP 7, PHP 8
Output a WebP image to browser or file
imagewebp
(
GdImage $image
,
resource
|
string
|
null $file
=
null
,
int $quality
= -
1
):
bool
imagepalettetotruecolor
(
$this
->
image
->
getCore
());
imagealphablending
(
$this
->
image
->
getCore
(),
true
);
imagesavealpha
(
$this
->
image
->
getCore
(),
true
);
imagewebp
(
$this
->
image
->
getCore
(),
null
,
$this
->
quality
);
$this
->
image
->
mime
=
defined
(
'IMAGETYPE_WEBP'
) ?
image_type_to_mime_type
(
IMAGETYPE_WEBP
) :
'image/webp'
;
$buffer
=
ob_get_contents
();
ob_end_clean
();
src/Intervention/Image/Gd/Encoder.php