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实现将Session写入数据库

使用session_set_save_handler()函数,将Session的内容写入数据库 <?php /* *@author Fahy *数据库为m...

windows下PHP APACHE MYSQ完整配置

经过最近一段时间狂热的PHP编程,对WINDOWS平台下PHP的配置可算是深有感触,一开始我用的是一键安装的傻瓜包,但是考虑傻瓜包的安装版本已经落后,在真正手动配置PHP环境时遇到许多问...

php实现等比例不失真缩放上传图片的方法

本文实例分析了php实现等比例不失真缩放上传图片的方法。分享给大家供大家参考,具体如下: 有时上传图片时因为图片太大了,不仅占用空间,消耗流量,而且影响浏(图片的尺寸大小不一)。下面分享...

如何用C语言编写PHP扩展的详解

如何用C语言编写PHP扩展的详解

1:预定义在home目录,也可以其他任意目录,写一个文件,例如caleng_module.def内容是你希望定义的函数名以及参数:int a(int x,int y)string b(s...

php中inlcude()性能对比详解

include性能 复制代码 代码如下: include('include.php'); 当然这种方式并没有错误,只不过在效率上它比下面的方式要稍稍差些: 复制代码 代码如下: inc...