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

相关文章

ThinkPHP中RBAC类的四种用法分析

本文实例讲述了ThinkPHP中RBAC类的四种用法。分享给大家供大家参考。具体方法如下: 第一类:放在登陆控制器的登陆操作中 1.RBAC::authenticate(); 用于在用户...

php实现获取文件mime类型的方法

本文实例讲述了php获取文件mime类型的方法。分享给大家供大家参考。具体如下: 1.使用 mime_content_type 方法 string mime_content_type...

PHP 编写的 25个游戏脚本

无论是一个人玩简单的使用纸和笔的游戏,还是同一群人玩复杂的桌面角色扮演游戏,或者任意类型的联机游戏,本系列都提供了适合您的内容。“用 PHP 可以编写的 30 个游戏脚本” 系列中的每篇...

php计算整个目录大小的方法

本文实例讲述了php计算整个目录大小的方法。分享给大家供大家参考。具体实现方法如下: /** * Calculate the full size of a directory *...

php简单实现无限分类树形列表的方法

本文实例讲述了php简单实现无限分类树形列表的方法。分享给大家供大家参考。具体如下: $items = array( 1 => array('id' => 1, '...