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定义一个数组最简单的方法

如何用php定义一个数组? php中定义数组的方法: 1、PHP定义数组的格式: 数组名=array(); 如:$aa=array();//这样就定义了一个数组, 之后给元素赋值:...

几篇关于无限分类算法的文章第1/5页

几篇关于无限分类算法的文章第1/5页

http://dev.mysql.com/tech-resources/articles/hierarchical-data.html By Mike Hillyer Introduc...

PHP中调用C/C++制作的动态链接库的教程

一般而言,php速度已经比较快,但是,对于一些较高级开发者而言,如果想要追求更快的速度,那毫无疑问可以通过自己写c代码,并编译为动态链接库(常为.so文件),然后php通过创建一个新的扩...

php字符比较函数similar_text、strnatcmp与strcasecmp用法分析

本文实例讲述了php字符比较函数similar_text、strnatcmp与strcasecmp用法。分享给大家供大家参考。具体如下: ① similar_text() 函数计算两个字...

PHP7 mongoDB扩展使用的方法分享

前言 最近在做的项目需要将PHP5.6升级到PHP7.0,使用过PHP-mongo扩展的同学应该知道,PHP7.0的mongodb扩展是完全不兼容PHP5.6的mongo扩展的,php-...