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程序设计有所帮助。

相关文章

THINKPHP2.0到3.0有哪些改进之处

THINKPHP2.0到3.0有哪些改进之处

1.thinkphp中我们的入口文件写法,可能最后要加一个app::run(); 3.0就完全不用了,你会发现不然会出现两次调用2.debug 我们开发的时候在2.0中我们一般都这样写...

php输入数据统一类实例

本文实例讲述了php输入数据统一类。分享给大家供大家参考。具体如下: <?php class cls_request{ private $getdata;//存储ge...

php file_get_contents取文件中数组元素的方法

用file_get_contents()抓取了 这个网址上的内容 http://simonfenci.sinaapp.com/index.php?key=simon&wd=131...

coreseek 搜索英文的问题详解

问题描述: 被搜索名字为:andy 这时搜索andy正常,但是搜索a就搜不到。 解决办法,在索引配置文件中的index中添加min_infix_len = 1最后还要重新索引一下/usr...

php文本转图片自动换行的方法

今天无意中浏览网面的时候发现一个长微博,它可以将文本转成png图片,于是乎就研究一下PHP文本转图片的方式,其实只要是用到了PHP的扩展库,GD库来生成图片,再通过图像函数生成,代码写出...