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数组游标实现对数组的各种操作。分享给大家供大家参考,具体如下: 如何不用foreach实现对数组实现循环? 答:我们只需要模拟foreach就行了,数组在执行...

利用PHP访问带有密码的Redis方法示例

一、首先设置Redis密码,以提供远程登陆 打开redis.conf配置文件,找到requirepass,然后修改如下: requirepass yourpassword you...

PHP mb_convert_encoding 获取字符串编码类型实现代码

后来又在手册上找到了is_utf8函数,这样,再结合iconv函数,我的问题就解决了。下面帖出这个函数: 复制代码 代码如下:function is_utf8($string) { re...

PHP实现会员账号单唯一登录的方法分析

本文实例讲述了PHP实现会员账号单唯一登录的方法。分享给大家供大家参考,具体如下: 情景再现 同一会员账号限制在同一台设备(电脑、手机、Ipad等)上单点登录,重复登录后,原登录访问页面...

PHP模块memcached使用指南

1.添加扩展包     php_memcache.dll 2.在PHP.INI添加     extension=php_memcache.dll 3.程序 复制代码 代码如下: <...