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]实用函数9

//执行输入 command 的外部程式或外部指令。返回 string 只是外部程式执行后传回的最后一行;若需要完整地返回信息,可以使用 ...

PHP邮件群发机实现代码

原理: 第一:申请大量的邮箱帐号 腾讯的 126的 163的 新浪的 雅虎的 谷歌的 等等提供smtp服务的 第二:收集你要发送邮件的邮件列表 第三:遍历邮件列表,每一个邮件发送邮...

以文件形式缓存php变量的方法

本文实例讲述了以文件形式缓存php变量的方法。分享给大家供大家参考。具体实现方法如下: <?php /* $cache_set = array( //缓存路径 , 最后...

php删除二维数组中的重复值方法

实例如下所示: //二维数组去掉重复值 public function a_array_unique($array){ $out = array(); foreach (...

Discuz5.5.0代码高亮显示+运行代码框合成插件 下载第1/4页

主要功能: 1.几乎支持所有程序代码的高亮显示,包括以下语言:Actionscript、ADA、Apache Log、AppleScript、ASM、ASP、AutoIT、Ba...