GD and Image 函数
在线手册:中文 英文
PHP手册

jpeg2wbmp

(PHP 4 >= 4.0.5, PHP 5)

jpeg2wbmp将 JPEG 图像文件转换为 WBMP 图像文件

说明

int jpeg2wbmp ( string $jpegname , string $wbmpname , int $d_height , int $d_width , int $threshold )

将名为 jpegname 的 JPEG 文件转换为 WBMP 格式,并存为 wbmpname。用 d_heightd_width 指定目标图像的高度和宽度。

Note: JPEG 支持仅在 PHP 与 GD-1.8 或更高版本一起编译时可用.

Note: WBMP 支持仅在 PHP 与 GD-1.8 或更高版本一起编译时可用.

参见 png2wbmp()

参数

jpegname

Path to JPEG file.

wbmpname

Path to destination WBMP file.

dest_height

Destination image height.

dest_width

Destination image width.

threshold

Threshold value, between 0 and 8 (inclusive).

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE.

范例

Example #1 jpeg2wbmp() example

<?php
// Path to the target jpeg
$path './test.jpg';

// Get the image sizes
$image getimagesize($path);

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

注释

Note: WBMP 支持仅在 PHP 与 GD-1.8 或更高版本一起编译时可用.

Note: JPEG 支持仅在 PHP 与 GD-1.8 或更高版本一起编译时可用.

参见


GD and Image 函数
在线手册:中文 英文
PHP手册
PHP手册 - N: 将 JPEG 图像文件转换为 WBMP 图像文件

用户评论:

barry dot schatz at gmail dot com (16-May-2009 04:41)

Actually this produces black and white images only, as does the jpeg2wbmp function.