imagecreatefromwebp

(PHP 5 >= 5.4.0, PHP 7, PHP 8)

imagecreatefromwebpCria uma nova imagem a partir de arquivo ou URL

Descrição

imagecreatefromwebp ( string $filename ) : GdImage|false

imagecreatefromwebp() returns an image identifier representing the image obtained from the given filename.

Dica

Uma URL pode ser utilizada como um nome de arquivo se fopen wrappers estiver ativo. Veja fopen() para mais detalhes em como especificar o filename. Veja também the Protocolos e Wrappers suportados para informações sobre que capacidades cada wrapper tem, notas de uso e informações sobre variáveis predefinidas fornecidas.

Parâmetros

filename

Path to the WebP image.

Valor Retornado

Retorna um resource de imagem no sucesso, false em erros.

Changelog

Versão Descrição
8.0.0 On success, this function returns a GDImage instance now; previously, a resource was returned.

Exemplos

Exemplo #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);
?>

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top