PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<imageistruecolorimagelayereffect>
Last updated: Mon, 16 Jul 2012

imagejpeg

(PHP 3 >= 3.0.16, PHP 4, PHP 5)

imagejpeg -- 以 JPEG 格式将图像输出到浏览器或文件

说明

int imagejpeg ( resource image [, string filename [, int quality]] )

imagejpeg()image 图像以 filename 为文件名创建一个 JPEG 图像。image 参数是 imagecreate() 函数的返回值。

filename 参数为可选,如果省略,则原始图像流将被直接输出。要省略 filename 参数而提供 quality 参数,使用空字符串('')。通过 header() 发送 Content-type: image/jpeg 可以使 PHP 脚本直接输出 JPEG 图像。

注: JPEG 支持仅在 PHP 编译时加入 GD-1.8 或更高版本时可用。

quality 为可选项,范围从 0(最差质量,文件更小)到 100(最佳质量,文件最大)。默认为 IJG 默认的质量值(大约 75)。

如果想输出渐进式 JPEG,需要用 imageinterlace() 函数将隔行扫描比特置位。

参见 imagepng()imagegif()imagewbmp()imageinterlace()imagetypes()




<imageistruecolorimagelayereffect>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST