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

相关文章

PHP6 中可能会出现的新特性预览

  这些特性包括:     集成OpCache(OPcache通过对PHP的opcode进行缓存和优化,可以提高PHP程序的执行速度) ...

php类中的各种拦截器用法分析

本文实例讲述了php类中的各种拦截器用法。分享给大家供大家参考。具体用法分析如下: 1、__get( $property ) 访问未定义的属性时调用 复制代码 代码如下:class la...

PHP各种常见经典算法总结【排序、查找、翻转等】

本文实例讲述了PHP各种常见经典算法。分享给大家供大家参考,具体如下: 冒泡排序算法 public function test() { $arr = array(43, 54...

PHP计算数组中值的和与乘积的方法(array_sum与array_product函数)

本文实例讲述了PHP计算数组中值的和与乘积的方法。分享给大家供大家参考,具体如下: 一、概述: array_sum() 函数用于计算数组中所有值的和。 array_product() 函...

php 判断访客是否为搜索引擎蜘蛛的函数代码

复制代码 代码如下: /** * 判断是否为搜索引擎蜘蛛 * * @author Eddy * @return bool */ function isCrawler() { $agent...