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

相关文章

详解phpmyadmin相关配置与错误解决

详解phpmyadmin相关配置与错误解决 缺少mcrypt扩展 sudo apt-get install php5-mcrypt sudo php5enmod mcrypt 检查:...

PHP实现登陆并抓取微信列表中最新一组微信消息的方法

本文实例讲述了PHP实现登陆并抓取微信列表中最新一组微信消息的方法。分享给大家供大家参考,具体如下: <?php $_G['wx_g'] = array('init'...

php 日期时间处理函数小结

php 计算小时数并化整为零复制代码 代码如下: /* Author: 杨宇 yangyu@sina.cn */ //参数$hours_min为数组,数组的格式为1:10,返回为1小时...

PHP 事务处理数据实现代码

复制代码 代码如下:public function insertUser ($userArray){ foreach ($userArray as $key => $value)...

QueryPath PHP 中的jQuery

官方主页  http://querypath.org/ QP API 手册  http://api.querypath.org/docs/ QueryPath(QP...