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字典树(Trie树)定义与实现方法示例

PHP字典树(Trie树)定义与实现方法示例

本文实例讲述了PHP字典树(Trie树)定义与实现方法。分享给大家供大家参考,具体如下: Trie树的概念(百度的解释):字典树又称单词查找树,Trie树,是一种树形结构,是一种哈希树的...

基于PHP实现数据分页显示功能

本文实例为大家分享了数据分页显示功能的PHP实现代码,供大家参考,具体内容如下 实现代码: <!DOCTYPE html> <html> <head&g...

php下使用iconv需要注意的问题

string iconv ( string $in_charset , string $out_charset , string $str ) 在使用这个函数进行字符串编码转换时,需要注...

使用PHPExcel操作Excel用法实例分析

本文实例分析了使用PHPExcel操作Excel用法。分享给大家供大家参考。具体分析如下: PHPExcel下载地址: http://www.codeplex.com/PHPExcel...

php简单获取复选框值的方法

本文实例讲述了php简单获取复选框值的方法。分享给大家供大家参考,具体如下: html: <form id="form1" name="form1" method="post"...