首先,PHP是最好的语言!
下面我们来说下PHP图像处理函数中的gd_info()函数。
gd_info() --取得当前安装的 GD 库的信息。
下面我们来实际输出一下(以THINKPHP5.0版本为例):
/**
* PHP 图像函数
*/
public function imgClass()
{
//取得当前安装的 GD 库的信息
var_dump(gd_info());
}
返回结果是数组,共有12个序列,下面将一一介绍。array (size=12)
'GD Version' => string 'bundled (2.1.0 compatible)' (length=26)
'FreeType Support' => boolean true
'FreeType Linkage' => string 'with freetype' (length=13)
'GIF Read Support' => boolean true
'GIF Create Support' => boolean true
'JPEG Support' => boolean true
'PNG Support' => boolean true
'WBMP Support' => boolean true
'XPM Support' => boolean true
'XBM Support' => boolean true
'WebP Support' => boolean true
'JIS-mapped Japanese Font Support' => boolean false
属性含义GD Version安装的 libgd 的版本。
Freetype Support如果安装了 Freetype 支持则为 TRUE。
Freetype LinkageFreetype 连接的方法。取值可能为:'with freetype', 'with TTF library' 和 'with unknown library'。本单元仅在 Freetype Support 的值为 TRUE 时有定义。
GIF Read Support如果包含有读取 GIF 图像的支持则为 TRUE。
GIF Create Support如果包含有创建 GIF 图像的支持则为 TRUE。
JPG Support如果包含有 JPG 支持则为 TRUE。
PNG Support如果包含有 PNG 支持则为 TRUE。
WBMP Support如果包含有 WBMP 支持则为 TRUE。
XPM Support如果包含有 XPM 支持则为 TRUE。
XBM Support如果包含有 XBM 支持则为 TRUE。
WebP Support如果包含有 WebP 支持则为 TRUE。
JIS-mapped Japanese Font Support如果包含有 JIS-mapped Japanese Font Support 支持则为 TRUE。