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修改Linux或Unix口令的方法分享

需要的工具和安装:   你必须安装下面的工具和软件:   –修改口令的Shell脚本;   – Sudo访问权;   – Apache or Lighttpd web服务器;   – P...

PHP实现向关联数组指定的Key之前插入元素的方法

本文实例讲述了PHP实现向关联数组指定的Key之前插入元素的方法。分享给大家供大家参考,具体如下: PHP 关联数组可以通过三种方式插入新元素: 1. $array[$insert_ke...

php多文件上传功能实现原理及代码

今天对多图片上传功能小小的研究了一下,把下面的代码整理出来,方便以后自己使用以及供大家交流 1、upload.html页面,即先是input type=file的文件: 复制代码 代码如...

PHP strtotime函数详解

先看手册介绍: strtotime — 将任何英文文本的日期时间描述解析为 Unix 时间戳 格式:int strtotime ( string $time [, int $now ]...

php修改指定文件后缀的方法

因项目需求,需要将asp后缀的修改成php,因懒于一个个修改。又觉得php跟Qt一样都是高级语言了,一般高级语言都有提供对获得的内容进行增删改查的函数。经过一番资料查找与代码测试,总结出...