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动态生成版权所有信息的方法

本文实例讲述了php动态生成版权所有信息的方法。分享给大家供大家参考。具体实现方法如下: function copyright($start, $owner) { $date = d...

PHP+shell实现多线程的方法

本文实例讲述了PHP+shell实现多线程的方法。分享给大家供大家参考。具体如下: 这里介绍如何借助shell脚本实现多线程。 先写个简单的php代码,这里为了让脚本执行时间更长,方便看...

C# WinForm中实现快捷键自定义设置实例

C# WinForm中实现快捷键自定义设置实例

本文源码下载:http://xiazai.jb51.net/201501/tools/cs-key-setting.rar 项目开发过程中,需要实现类似有道词典的软件设置中的自定义快捷键...

php字符串分割函数用法实例

本文实例讲述了php字符串分割函数用法。分享给大家供大家参考。具体分析如下: php中explode 和 split 函数用来分割字符串。 explode函数语法如下 explode...

php使用glob函数快速查询指定目录文件的方法

本文实例讲述了php使用glob函数快速查询指定目录文件的方法。分享给大家供大家参考。具体如下: php搜索当前目录所有文件,代码如下: 复制代码 代码如下:$array = glob(...