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 session_start()出错原因分析及解决方法

错误提示: Warning: session_start() [function.session-start]: Cannot send session cache limiter -...

PHP基于二分法实现数组查找功能示例【循环与递归算法】

PHP基于二分法实现数组查找功能示例【循环与递归算法】

本文实例讲述了PHP基于二分法实现数组查找功能。分享给大家供大家参考,具体如下: 二分法。分别使用while循环的方法和递归调用的方法。 <?php // 二分法的使用...

PHP序列化操作方法分析

本文实例讲述了PHP序列化操作方法。分享给大家供大家参考,具体如下: 序列化就是将变量数据转换为字符串(跟类型转换机制不同),一般应用于存储数据(文件),然后在别的情形下恢复(反序列化)...

PHP中类的继承和用法实例分析

本文实例讲述了PHP中类的继承和用法。分享给大家供大家参考,具体如下: 1、继承关键字 :extends PHP类的继承,我们可以理解成共享被继承类的内容。PHP中使用extends单一...

深入探讨&quot;&amp;lt;br /&amp;gt;&quot;和 &quot;\r\n&quot; 两者有什么区别??

\r\n是输出的HTML代码换行,客户看到的效果没有换行。<br />则相反效果:我是内容\r\n我是内容我是内容<br />我是内容==============...