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相关函数文档,发现php本身是没有函数实现这个功能的,所以不得不自己解决了。...

PHP生成数组再传给js的方法

<script type="text/javascript"> var slist = '<?php echo urlencode(json_encod...

linux下删除7天前日志的代码(php+shell)

PHP版本: 复制代码 代码如下: /** * 删除7天前的日志 * @param $logPath */ function del7daysAgoLog($logPath) { if(...

DOM基础及php读取xml内容操作的方法

DOM基础及php读取xml内容操作的方法

本文实例讲述了DOM基础及php读取xml内容操作的方法。分享给大家供大家参考。具体分析如下: DOM(Document Object Model):文档对象模型。核心思想是:把 xml...

php中引用&的用法分析【变量引用,函数引用,对象引用】

php中引用&的用法分析【变量引用,函数引用,对象引用】

本文实例分析了php中引用&的用法。分享给大家供大家参考,具体如下: php的引用(就是在变量或者函数、对象等前面加上&符号) //最重要就是 删除引用的变量 ,只是引用的变量访问不了,...