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 GD绘制24小时柱状图

80,250,430,134,35,60,233,90,263,225,120,59,151,677,340,221,550,300,229,97,230,123,133,87 ...

PHP中exec与system用法区别分析

本文实例讲述了PHP中exec与system用法区别,分享给大家供大家参考之用。具体方法如下: 一般来说,在PHP中调用外部命令,可以用exec及system来实现: system()...

php实现求相对时间函数

本文实例讲述了php实现求相对时间函数。分享给大家供大家参考。具体实现方法如下: <?php function relativeTime($time = false,...

zend api扩展的php对象的autoload工具

类似spl的autoload功能,bloader为php对象的autoload工具,但相比较起来更简单高效,配置也更灵活. bloader提供一个常用的autoload函数ld,以及两个...

php结合curl实现多线程抓取

php结合curl实现多线程抓取 <?php /* curl 多线程抓取 */ /** * curl 多线程 * * @param array...