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 Memcached + APC + 文件缓存封装实现代码

使用方法: Memcached 复制代码 代码如下: $cache = new Cache_MemCache(); $cache->addServer('www1'); $cach...

PHP实现双链表删除与插入节点的方法示例

本文实例讲述了PHP实现双链表删除与插入节点的方法。分享给大家供大家参考,具体如下: 概述: 双向链表也叫双链表,是链表的一种,它的每个数据结点中都有两个指针,分别指向直接后继和直接前驱...

php中jpgraph类库的使用介绍

用Jpgraph,只要了解它的一些内置函数,可以轻松得画出折线图、柱形图、饼状图等图表。 首先要保证PHP打开了Gd2的扩展: 打开PHP.ini,定位到extension=php_gd...

php如何执行非缓冲查询API

对于PHP的缓冲模式查询大家都知道,下面列举的例子是如何执行非缓冲查询API。 非缓冲查询方法一: mysqli <?php $mysqli = new mysqli(...

PHP ajax 异步执行不等待执行结果的处理方法

短地址生成应用中,要根据长地址生成网页快照,这个生成时间非瞬发,不可预估。 所以前台方面采用的方案一般为先展示生成的短地址,再定期AJAX轮查网页快照是否生成完毕。 So,PHP代码这里...