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函数

1.产生随机字符串函数 function random($length) { $hash = @#@#; $chars = @#abcdefghijklmnopqrstuvwxyz012...

PHP反射API示例分享

本文实例为大家分享了 PHP反射API--利用反射技术实现的插件系统架构,供大家参考,具体内容如下 <?php /** * @name PHP反射API--利用反射...

php实现字符串翻转的方法

本文实例讲述了php实现字符串翻转的方法。分享给大家供大家参考。具体实现方法如下: <?php header("content-type:text/html;chars...

php的access操作类

复制代码 代码如下:<?php     --------------------------------------------------...

PHP基于curl实现模拟微信浏览器打开微信链接的方法示例

本文实例讲述了PHP基于curl实现模拟微信浏览器打开微信链接的方法。分享给大家供大家参考,具体如下: 网络上没有可以直接打开微信的浏览器 但是我们可以模拟浏览器 微信浏览器的HTTP_...