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防止表单重复提交的几种常用方法汇总

本文较为详细的汇总了PHP防止表单重复提交的几种常用方法,在PHP程序开发中有着很高的实用价值。具体方法如下: 1. 使用JS让按钮在点击一次后禁用(disable)。采用这种方法可以防...

php实现希尔排序算法的方法分析

本文实例讲述了php实现希尔排序算法的方法。分享给大家供大家参考,具体如下: 虽然现在各种程序语言都有其各自强大的排序库函数,但是这些底层实现也都是利用这些基础或高级的排序算法。 理解这...

Discuz Uchome ajaxpost小技巧

比如默认submit按钮这样操作:onclick="ajaxpost('formid')";之类的,我们可以先这样。。 onclick="$('__formid').innerText=...

PHP 事件机制(2)

复制代码 代码如下: <?php class Event extends stdClass{ public $target=null; public $type=null; /**...

PHP计算当前坐标3公里内4个角落的最大最小经纬度实例

本文实例讲述了PHP计算当前坐标3公里内4个角落的最大最小经纬度的方法。分享给大家供大家参考,具体如下: //$lng 、$lat 经纬度 $half = 6371;...