exif_thumbnail() - exif函数(可交换图像信息)
exif_thumbnail()
(PHP 4 >= 4.2.0, PHP 5, PHP 7)
取得嵌入在 TIFF 或 JPEG 图像中的缩略图
说明
exif_thumbnail(string $filename[,int &$width[,int &$height[,int &$imagetype]]]): stringexif_thumbnail()读取TIFF或JPEG图像中的嵌入缩略图。如果图像不包含缩略图则返回FALSE
。
If you want to deliver thumbnails through this function, you should send the mimetype information using the header() function.
It is possible that exif_thumbnail() cannot create an image but can determine its size. In this case, the return value is FALSE
but$widthand$heightare set.
参数
$filenameThe name of the image file being read. This image contains an embedded thumbnail.
$widthThe return width of the returned thumbnail.
$heightThe returned height of the returned thumbnail.
$imagetypeThe returned image type of the returned thumbnail. This is either TIFF or JPEG.
返回值
Returns the embedded thumbnail, or FALSE
if the image contains no thumbnail.
更新日志
版本 | 说明 |
---|---|
4.3.0 | The optional parameters$width,$height, and$imagetypeall became available. |
4.3.0 | May return thumbnails in the TIFF format. |
范例
exif_thumbnail()例子
参见
exif_read_data()
从 JPEG 或 TIFF 文件中读取 EXIF 头信息image_type_to_mime_type()
取得 getimagesize,exif_read_data,exif_thumbnail,exif_imagetype 所返回的图像类型的 MIME 类型
use this if you want to embed a thumbnail directly on the HTML page without writing it first to a file: