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

相关文章

深入探讨"<br />"和 "\r\n" 两者有什么区别??

\r\n是输出的HTML代码换行,客户看到的效果没有换行。<br />则相反效果:我是内容\r\n我是内容我是内容<br />我是内容==============...

PHP获取文件夹大小函数用法实例

本文实例讲述了PHP获取文件夹大小函数用法。分享给大家供大家参考。具体如下: <?php // 获取文件夹大小 function getDirSize($dir)...

php关于array_multisort多维数组排序的使用说明

一、先看最简单的情况。有两个数组: 复制代码 代码如下: $arr1 = array(1,9,5); $arr2 = array(6,2,4); array_multisort($arr...

PHP实现读取一个1G的文件大小

需求如下: 现有一个1G左右的日志文件,大约有500多万行, 用php返回最后几行的内容。 1. 直接采用file函数来操作 or file_get_content() 肯定报内存溢出注...

Function eregi is deprecated (解决方法)

在php升级到php5.3之后后,在使用的过程经常发现有的程序会出现Function eregi() is deprecated 的报错信息。是什么原因呢?这是因为php5.3中不再支持...