PHP获取Exif缩略图的方法

yipeiwu_com5年前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 switch语句多个值匹配同一代码块应用示例

先说说switch()语句的格式 switch(表达式){ case 匹配1: 当匹配1和表达式匹配成功执行的代码; break; case 匹配2: 当匹配2和表达式匹配成功执行的代码...

详解PHP版本兼容之openssl调用参数

背景与问题解决方式 老项目重构支付宝部分代码整合支付宝新的sdk时发现验签总是失败,才发现是open_verify最后的参数传输问题。而open_sign同样如此。本文主要说明open_...

IIS+fastcgi下PHP运行超时问题的解决办法详解

每在页面中上传较大的文件时遇到FastCgi的错误:“The FastCGI process exceeded configured request timeout”,几经试验,明白了需...

解析php中如何调用用户自定义函数

先放上来别人的例子吧:call_user_func函数类似于一种特别的调用函数的方法,使用方法如下:    复制代码 代码如下:function a($b,...

PHP strtotime函数用法、实现原理和源码分析

源码位置:\ext\date\php_date.c 复制代码 代码如下: /* {{{ proto int strtotime(string time [, int now ]) &nb...