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笔记之:AOP的应用

介绍 你以前听说过AOP(Aspect Oriented Programming)吗?虽然在php方面,好像没有过多的使用,但是在企业级开发中,AOP被广泛使用。我将借此文,向...

PHP简单创建日历的方法

PHP简单创建日历的方法

本文实例讲述了PHP简单创建日历的方法。分享给大家供大家参考,具体如下: <?php function build_calendar($month,$year) {...

PHP语法小结之基础和变量

最近有个H5项目的需求,需要服务端,考察过后决定用PHP实现一个HTTP服务端,于是开始重温PHP语法,顺便记录一下要点,以便随时重温。内容摘抄自w3school的PHP手册,并按照自己...

一个简单的php加密解密函数(动态加密)

复制代码 代码如下:function encode_pass($tex,$key,$type="encode"){    $chrArr=array('a'...

分享一下贝贝成长进度的php代码

主要功能是根据贝贝的出生日期来显示贝贝现在多大了,实时显示贝贝的成长。 用当前时间减去出生的日期,但是可以显示出来几岁,几个月,和几天。 天的算法有点问题,没有考虑到大小月和2月份。 复...