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连接Access数据库的注意事项

谈谈PHP连接Access数据库的注意事项

首先需要注意: 安装access 数据库的时候 需要安装与本机系统相互匹配的office版本,win7 64位的系统 ,那么Office也要是64位的 最好装 office2010。。。...

php数组函数序列之in_array() 查找数组值是否存在

in_array() 定义和用法 in_array() 函数在数组中搜索给定的值。 语法 in_array(value,array,type) 参数 描述 value 必需。规定要在数组...

PHP迭代器和迭代的实现与使用方法分析

本文实例讲述了PHP迭代器和迭代的实现与使用方法。分享给大家供大家参考,具体如下: PHP的面向对象引擎提供了一个非常聪明的特性,就是,可以使用foreach()方法通过循环方式取出一个...

9个实用的PHP代码片段分享

一.查看邮件是否已被阅读        当你发送邮件时,你肯定很想知道你的邮件是否已被对方查看。下面的代码就能实现记录阅读你...

Gregarius中文日期格式问题解决办法

复制代码 代码如下: function rss_locale_date ($fmt, $ts, $addTZOffset = ...