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常用Stream函数集介绍

stream_bucket_append函数:为队列添加数据 stream_bucket_make_writeable函数:从操作的队列中返回一个数据对象stream_bucket_ne...

使用php来实现网络服务

作者:samisa 以下文中的翻译名称对照表 : payload: 交谈内容 object: 实例 function: 函数 使用 php来实现网络服务 使用框架: WSO2 WSF/P...

使用PHP计算两个路径的相对路径

复制代码 代码如下:<html>     <body>     &nbs...

PHP面向对象程序设计方法实例详解

本文实例分析了PHP面向对象程序设计方法。分享给大家供大家参考,具体如下: PHP5开始支持面向对象,示例如下: <?php class classna...

php 信息采集程序代码

复制代码 代码如下:<? //采集首页地址 $url="http://emotion.pclady.com.cn/skills/"; //获取页面代码 $rs=file_get_c...