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

相关文章

javascript+php实现根据用户时区显示当地时间的方法

本文实例讲述了javascript+php实现根据用户时区显示当地时间的方法。分享给大家供大家参考。具体如下: 在跨时区应用中会用到下面代码,这是以前写的一段代码。 服务器保存相关时间配...

浅谈apache和nginx的rewrite的区别

1. Nginx Rewrite规则相关指令 Nginx Rewrite规则相关指令有if、rewrite、set、return、break等,其中rewrite是最关键的指令。一个简...

ionCube 一款类似zend的PHP加密/解密工具

PHP本身没有带有ionCube loader模块, 必须到ionCube网站下载。ionCube loader是免费的,但是Encoder的价格就比较昂贵(起价$199)。 下面要介...

php 获取今日、昨日、上周、本月的起始时间戳和结束时间戳的方法

目录 一、总结 一句话总结:使用mktime()函数即可:PHP mktime() 函数用于返回一个日期的 Unix 时间戳。 1、mktime()如何获取昨天的开始时间和结束时间? 二...

关于JSON以及JSON在PHP中的应用技巧

JSON 基础 简单地说,JSON 可以将 JavaScript 对象中表示的一组数据转换为字符串,然后就可以在函数之间轻松地传递这个字符串,或者在异步应用程序中将字符串从 Web 客户...