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打印输出棋盘的实现方法

本文实例讲述了php打印输出棋盘的两种实现方法。分享给大家供大家参考。具体实现方法如下: 例子1,代码如下: 复制代码 代码如下:<?php /**  * 隔...

PHP简单判断iPhone、iPad、Android及PC设备的方法

本文实例讲述了PHP简单判断iPhone、iPad、Android及PC设备的方法。分享给大家供大家参考,具体如下: 因为工作需要我们需要知道是什么样了用户访问了我网站了,现在的移动设备...

浅析PHP中Collection 类的设计

用.net开发已经很多年了,最近接触到php,发现php也很好玩。不过发现它里面没有集合Collection类,只有数组,并且数组很强。这里我用数组来包装成一个集合Collection,...

解决phpmyadmin中文乱码问题。。。

解决phpmyadmin中文乱码问题。。。 去phpMyAdmin的根目录下,打开以下这个文件: libraries/select_lang.lib.php    1、找到有"zh-gb...

10条php编程小技巧

1、写程序的时候会用到这种情况,比如对一个数字进行四舍五入取整。很多人会这样写: 复制代码 代码如下: input a if a - int(a) >= 0.5 then a =&...