jpeg2wbmp

(PHP 4 >= 4.0.5, PHP 5, PHP 7)

jpeg2wbmpConverte arquivo de imagem JPEG para WBMP

Aviso

Esta função tornou-se DEFASADA a partir do PHP 7.2.0 e foi REMOVIDA a partir do PHP 8.0.0. O uso desta função é fortemente desencorajado.

Descrição

jpeg2wbmp(
    string $jpegname,
    string $wbmpname,
    int $dest_height,
    int $dest_width,
    int $threshold
): bool

Converte um arquivo JPEG em um WBMP.

Parâmetros

jpegname

Caminho para o arquivo JPEG.

wbmpname

Caminho para o arquivo WBMP de destino.

dest_height

Altura da imagem de destino.

dest_width

Largura da imagem de destino.

threshold

Valor de limite, entre 0 e 8 (inclusive).

Valor Retornado

Retorna true em caso de sucesso ou false em caso de falha.

Cuidado

Entretanto, se a biblioteca libgd falhar ao gerar a imagem, esta função retornará true.

Exemplos

Exemplo #1 Exemplo de jpeg2wbmp()

<?php
// Caminho para o JPEG alvo
$path = './test.jpg';

// Obtém o tamanho da imagem
$image = getimagesize($path);

// Converte a imagem
jpeg2wbmp($path, './test.wbmp', $image[1], $image[0], 5);
?>

Veja Também

  • png2wbmp() - Converte arquivo de imagem PNG em WBMP
add a note add a note

User Contributed Notes 1 note

up
-6
barry dot schatz at gmail dot com
14 years ago
Actually this produces black and white images only, as does the jpeg2wbmp function.
To Top