PHP获取Exif缩略图的方法

yipeiwu_com6年前PHP代码库

本文实例讲述了PHP获取Exif缩略图的方法。分享给大家供大家参考。具体实现方法如下:

// file to read
$file = 'test.jpg';
$image = exif_thumbnail($file, $width, $height, $type);
// width, height and type get filled with data
// after calling "exif_thumbnail"
if ($image) {
  // send header and image data to the browser:
  header('Content-type: ' .image_type_to_mime_type($type));
  print $image;
}
else {
  // there is no thumbnail available, handle the error:
  print 'No thumbnail available';
}

希望本文所述对大家的php程序设计有所帮助。

相关文章

PHP备份数据库生成SQL文件并下载的函数代码

复制代码 代码如下: <!?php /****** 备份数据库结构 ******/ /* 函数名称:table2sql() 函数功能:把表的结构转换成为SQL 函数参数:$tabl...

php中使用parse_url()对网址进行解析的实现代码(parse_url详解)

PHP 解析 URL函数: parse_url详解 parse_url — 解析 URL,返回其组成部分 说明 array parse_url ( string $url ) 本函数解析...

PHP实现的下载远程文件类定义与用法示例

本文实例讲述了PHP实现的下载远程文件类定义与用法。分享给大家供大家参考,具体如下: <?php /** * 下载远程文件类支持断点续传 */ class Http...

[PHP]实用函数8

//建立dBase资料表 int dBase_create(string filename,array fields) //打开dBase资料表 int&n...

php生成随机数的三种方法

如何用php生成1-10之间的不重复随机数? 例1,使用shuffle函数生成随机数。 <?php $arr=range(1,10); shuffle($arr); f...