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

相关文章

使用Curl进行抓取远程内容时url中文编码问题示例探讨

PHP中对于URL进行编码,可以使用 urlencode() 或者 rawurlencode(),二者的区别是前者把空格编码为 '+',而后者把空格编码为 '%20',不过应该注意的是,...

PHP定时任务获取微信access_token的方法

本文实例讲述了PHP定时任务获取微信access_token的方法。分享给大家供大家参考,具体如下: 微信access_token在开发时会变的好像是几分种不一样了,这里我们来介绍关于P...

PHP常用的类封装小结【4个工具类】

本文实例讲述了PHP常用的类封装。分享给大家供大家参考,具体如下: 这4个类分别是Mysql类、 分页类、缩略图类、上传类。 Mysql类 <?php /** * M...

使用php将某个目录下面的所有文件罗列出来的方法详解

直接给源代码了:复制代码 代码如下:$current_dir = 'E:/temp/';$dir = opendir($current_dir);echo "direcotry list...

使用Zookeeper分布式部署PHP应用程序

Zookper是一种分布式的,开源的,应用于分布式应用的协作服务。它提供了一些简单的操作,使得分布式应用可以基于这些接口实现诸如同步、配置维护和分集群或者命名的服务。Zookper很容易...