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新手NOTICE错误常见解决方法

刚学习PHP,不久,一般就看看手册,和一本叫PHP和mysql web开发的。 最近在整留言板,刚才遇到个问题。 页面中,好多类似 Notice: Use of undefined co...

php多任务程序实例解析

本文以实例简单解析了php多任务程序的实现方法,具体代码如下: <?php error_reporting(E_ALL); set_time_limit(0); /**...

关于更改Zend Studio/Eclipse代码风格主题的介绍

关于更改Zend Studio/Eclipse代码风格主题的介绍

最近决定把几个IDE的代码样式统一一下,Visual Studio的还算好改,PHP目前用得不多,不过也打算给Zend Studio换身新装。 网上搜索的一些更改Zend Studio主...

深入掌握include_once与require_once的区别

①作用及用法   可以减少代码的重复   include(_once)("文件的路径")与require(_once)("文件的路径") ②理解   说白了,就是用包含进来的文件中的内容...

解析PHP留言本模块主要功能的函数说明(代码可实现)

一,敏感词处理1,过滤敏感词preg_match()函数用来在字符串中搜索所有与给定的正则表达式匹配的内容,如果存在则返回True,否则返回False。语法:int preg_match...