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

相关文章

Mac系统下安装PHP Xdebug

Mac系统下安装PHP Xdebug

Mac下安装PHP调试工具Xdebug 安装步骤 brew install php70 brew install php70-xdebug php -i | grep...

PHP从FLV文件获取视频预览图的方法

本文实例讲述了PHP从FLV文件获取视频预览图的方法。分享给大家供大家参考。具体实现方法如下: 复制代码 代码如下:<?php // references http://w...

php UBB 解析实现代码

复制代码 代码如下: /** +---------------------------------------------------------- * UBB 解析 +--------...

PHP实现一维数组转二维数组的方法

本文实例讲述了PHP实现一维数组转二维数组的方法。分享给大家供大家参考。具体实现方法如下: <?php $asr[1] = array("a","b","c","d"...

php usort 使用用户自定义的比较函数对二维数组中的值进行排序

今天发现一个很好用二维数组排序的php方法,usort,推荐给大家,以后二维数组里面,要按照一个字段的值排序用这个方法简单高效,例如下面的数组: [guess_subject] =&...