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实现httpRequest的方法

本文实例讲述了php实现httpRequest的方法。分享给大家供大家参考。具体如下: 想从学校图书馆的网站上抓取数据处理之后在返回给浏览器,试了不少方法。首先试了http_reques...

深入解析PHP中foreach语句控制数组循环的用法

foreach是PHP中很常用的一个用作数组循环的控制语句。 因为它的方便和易用,自然也就在后端隐藏着很复杂的具体实现方式(对用户透明) 今天,我们就来一起分析分析,foreach是如何...

JoshChen_web格式编码UTF8-无BOM的小细节分析

JoshChen_web格式编码UTF8-无BOM的小细节分析

但是在开发的过程中,发现一个小细节的问题,必须要打开F12才能看到的,原来,在head头部里面的所有引用的东西以及title等等,全部都跑到body里面去了,苦思冥想,百度、google...

PHP中通过加号合并数组的一个简单方法分享

代码: 复制代码 代码如下: <?php $a = array('a' => 'a', 'b' => 'b'); $b = array('c' => 'c', '...

Windows下安装Memcached的步骤说明

(其实在Windows下安装还是比较简单的) 源码包准备: 1,memcached 1.2.1 for Win32 binaries 这个是 Win32 服务器端的 memcached...