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多维数组遍历方法(2种实现方法)

本文实例讲述了PHP多维数组遍历方法。分享给大家供大家参考,具体如下: 方法一: $a=array('fruits'=>array('a'=>'orange', 'b...

PHP数组排序之sort、asort与ksort用法实例

本文实例讲解了PHP数组排序中sort、asort与ksort的用法,供大家参考借鉴之用。具体实例如下所示: <?php $arr = array('d'=>'s...

PHP冒泡排序算法代码详细解读

复制代码 代码如下: <?php $arr = array(345,4,17,6,52,16,58,69,32,8,234); $n = count($arr); for($i=1...

php中的登陆login

login <?php require "../include/DBClass.php"; $username=$_POST['UserName']; $password...

PHP排序算法之快速排序(Quick Sort)及其优化算法详解

本文实例讲述了PHP排序算法之快速排序(Quick Sort)及其优化算法。分享给大家供大家参考,具体如下: 基本思想: 快速排序(Quicksort)是对冒泡排序的一种改进。他的基本思...