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反射机制来构造"CREATE TABLE"的sql语句

反射是指在PHP运行状态中,扩展分析PHP程序,导出或提取出关于类、方法、属性、参数等的详细信息,包括注释。这种动态获取的信息以及动态调用对象的方法的功能称为反射API。反射是操纵面向对...

PHP中的extract的作用分析

addslashes -- 使用反斜线引用字符串      extract(addslashes($_POST));...

php常用hash加密函数

本文实例讲述了php常用hash加密函数。分享给大家供大家参考。具体分析如下: 复制代码 代码如下:$hash_list=hash_algos();  //返回注册的hash规...

PHP中Array相关函数简介

使用函数array_keys(),得到数组中所有的键,参数:数组 $arr=array(); $arr['one']="one"; $arr['two']="two"; $arr['...

PHP基于面向对象实现的留言本功能实例

PHP基于面向对象实现的留言本功能实例

本文实例讲述了PHP基于面向对象实现的留言本功能。分享给大家供大家参考,具体如下: 要设计一留言本,一切都将以留言本为核心,抓到什么是什么,按流程走下来,即按用户填写信息->留言-...