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进程通信基础之信号

使用信号通信。可以使用kill -l 来查看当前系统的信号类型。 每个信号所代表的的详细含义,请查看我的这篇文章:https://www.jb51.net/article/106040...

解决file_get_contents无法请求https连接的方法

错误: Warning: fopen() [function.fopen]: Unable to find the wrapper "https" - did you forget to...

PHP实现HTML页面静态化的方法

PHP实现HTML页面静态化的方法

随着网站的内容的增多和用户访问量的增多,无可避免的是网站加载会越来越慢,受限于带宽和服务器同一时间的请求次数的限制,我们往往需要在此时对我们的网站进行代码优化和服务器配置的优化。 一般情...

PHP中通过加号合并数组的一个简单方法分享

代码: 复制代码 代码如下: <?php $a = array('a' => 'a', 'b' => 'b'); $b = array('c' => 'c', '...

PHP面向对象程序设计OOP继承用法入门示例

本文实例讲述了PHP面向对象程序设计OOP继承用法。分享给大家供大家参考,具体如下: <?php class Person { var $name;//protec...