imagecreatefromwebp
(PHP 5 >= 5.5.0, PHP 7)
imagecreatefromwebp — Create a new image from file or URL
Descrição
resource imagecreatefromwebp
( string
$filename
)imagecreatefromwebp() returns an image identifier representing the image obtained from the given filename.
Tip
Você pode usar uma URL como um nome de arquivo nesta função se fopen wrappers estiver habilitado. Veja fopen() para mais detalhes em como especificar o nome do arquivo e Protocolos e wrappers suportados para uma lista de protocolos URL suportados.
Parâmetros
-
filename -
Path to the WebP image.
Valor Retornado
Returns an image resource identifier on success, FALSE on errors.
Exemplos
Example #1 Convert an WebP image to a jpeg image using imagecreatefromwebp()
<?php
// Load the WebP file
$im = imagecreatefromwebp('./example.webp');
// Convert it to a jpeg file with 100% quality
imagejpeg($im, './example.jpeg', 100);
imagedestroy($im);
?>