PHP获取Exif缩略图的方法

yipeiwu_com5年前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新手用的Insert和Update语句构造类

使用方法 复制代码 代码如下: $mysql = new sqlstr("table1"); $mysql->set("name","value"); $mysql->set...

PHP中echo,print_r与var_dump区别分析

本文较为详细的分析了PHP中echo,print_r与var_dump区别。分享给大家供大家参考。具体分析如下: 三者都是具有输出功能的php语句,但print_r(expression...

分享8个最佳的代码片段在线测试网站

分享8个最佳的代码片段在线测试网站

有时候,我们需要测试一些代码片段,而电脑中没有安装针对该语言的运行环境,没关系,你可以在线测试它们。  本文为你带来 8 款非常好用的代码片段在线工具,帮助你快速、方便地测试、...

Drupal7 form表单二次开发要点与实例

请记得收藏此文,在你进行Drupal 7 custom module时,经常会用到的form 表单的跳转或重载。主要汇总三个要点: 1.页面提交后,经过#submit处理后,需要redi...

PHP魔术方法之__call与__callStatic使用方法

核心代码 //魔术方法__call /* $method 获得方法名 $arg 获得方法的参数集合 */ class Human { private function t(...