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 //URL是远程的完整图片地址,不能为空, $filename 是另存为的图片名字 //默认把图片放在以此脚本相同的目...

修改Zend引擎实现PHP源码加密的原理及实践

一、基本原理   考虑截获PHP读取源文件的接口。一开始,我考虑从Apache和PHP 之间的接口处处理,参见apache的src/modules/php4/mod_php4.c...

PHP文件上传原理简单分析

//表单上传只能使用multipart/form-data编码格式 $_FILES系统函数; $_FILES['myFile']['name']文件名称 $_FILES['myFile'...

PHP中将数组转成XML格式的实现代码

下面是网上的 复制代码 代码如下: class ArrayToXML { /** * The main function for converting to an XML documen...

使用php实现快钱支付功能(涉及到接口)

本项目用zend framework框架实现的modules/default/controllers/IndexController.phpIndexController.php复制代码...