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中Static(静态)关键字功能与用法实例分析

本文实例讲述了PHP中Static(静态)关键字功能与用法。分享给大家供大家参考,具体如下: 1、什么是static? static 是C++中很常用的修饰符,它被用来控制变量的...

PHP实现将上传图片自动缩放到指定分辨率,并保持清晰度封装类示例

本文实例讲述了PHP实现将上传图片自动缩放到指定分辨率,并保持清晰度封装类。分享给大家供大家参考,具体如下: class AutoImage{ private $image;...

php常用hash加密函数

本文实例讲述了php常用hash加密函数。分享给大家供大家参考。具体分析如下: 复制代码 代码如下:$hash_list=hash_algos();  //返回注册的hash规...

PHP EOT定界符的使用详解

结束标识符必须从行的第一列开始。同样,标识符也必须遵循 PHP 中其它任何标签的命名规则:只能包含字母数字下划线,而且必须以下划线或非数字字符开始。 警告 很重要的一点必须指出,结束标识...

PHP批量生成图片缩略图的方法

本文实例讲述了PHP批量生成图片缩略图的方法。分享给大家供大家参考。具体如下: <?php //用PHP批量生成图片缩略图 function mkdirs($dirn...