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使用date和strtotime函数输出指定日期的方法

本文实例讲述了php使用date和strtotime函数输出指定日期的方法。分享给大家供大家参考。具体方法分析如下: 在php中date和strtotime函数都是对日期操作的,但是在生...

php微信公众开发之获取周边酒店信息的方法

本文实例讲述了php微信公众开发之获取周边酒店信息的方法。分享给大家供大家参考。具体分析如下: 关注微信公众之后发送回复地理位置信息,即可回复周边附近的酒店信息列表,下面我就来给各位介绍...

PHP STRING 陷阱原理说明

A string is series of characters. String access and modification by character Characters with...

php抓取并保存网站图片的实现代码

此程序实现了网页源代码捕获,图片链接获取、分析、并将同样的图片链接合并功能,实现了图片抓取功能。利用php强大的网络内容处理函数将指定的网站上的所有图片抓取下来,保存在当前目录下,以下为...

php基于dom实现读取图书xml格式数据的方法

本文实例讲述了php基于dom实现读取图书xml格式数据的方法。分享给大家供大家参考,具体如下: <?php $doc = new DOMDocument(); $...