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代码片段。 1. 发送短信 调用 TextMagic API。 // Include the TextMagic P...

PHP几个数学计算的内部函数学习整理

round round - 对浮点数进行四舍五入。round 函数语法如下: round(float,precision) 其中参数 precision 表示小数点后面要保持的精度位数。...

phpadmin如何导入导出大数据文件及php.ini参数修改

最近遇到了数据库过大的时候用phpadmin导入的问题,新版本的phpadmin导入限定是8M,老版本的可能2M,我的数据库有几十兆这可怎么办呢? 首先如果你有独立服务器或vps的话可以...

PHP赋值的内部是如何跑的详解

PHP赋值的内部是如何跑的详解

前言 在PHP中,一个变量被赋值,内部到底经历了怎样的逻辑判断呢? PHP在内核中是通过zval这个结构体来存储变量的,它的定义在Zend/zend.h文件里 struct _zva...

php实现的读取CSV文件函数示例

本文实例讲述了php实现的读取CSV文件函数。分享给大家供大家参考,具体如下: function read_csv($cvs) { $shuang = false; $str...