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生成过去100年下拉列表的方法

本文实例讲述了php生成过去100年下拉列表的方法。分享给大家供大家参考。具体如下: 项目中经常会用到年份选择,这段代码自动生成从今年开始的过去100年的下拉列表 <selec...

wordpress之wp-settings.php

接上面开始wp-config.php,wp-settings.php这两个文件,wp-config.php故名恩意配置文件所以没什么可解释的。 wp-settings.php最上在的函数...

php函数传值的引用传递注意事项分析

本文实例讲述了php函数传值的引用传递注意事项。分享给大家供大家参考,具体如下: Strict standards: Only variables should be passed by...

PHP字符串中插入子字符串方法总结 原创

本文实例讲述了PHP字符串中插入子字符串方法。分享给大家供大家参考,具体如下: 首先来看看一个网上常见的方法: 方法一:字符串遍历 function str_insert($str,...

PHP使用get_headers函数判断远程文件是否存在的方法

本文实例讲述了PHP使用get_headers函数判断远程文件是否存在的方法。分享给大家供大家参考。具体实现方法如下: 以前讲过程关于php判断远程文件是否存在的文章都是利用fopen,...