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 $source = array('pll','我','爱',...

php实现按照权重随机排序数据的方法

本文实例讲述了php实现按照权重随机排序数据的方法。分享给大家供大家参考。 具体实现方法如下: 复制代码 代码如下: <?php   /** ...

PHP 图片合成、仿微信群头像的方法示例

本文实例讲述了PHP 图片合成、仿微信群头像的方法。分享给大家供大家参考,具体如下: 参考文章: 作者:凯歌~,php图片合成方法(多张图片合成一张)https://www.jb51.n...

php set_magic_quotes_runtime() 函数过时解决方法

把函数: set_magic_quotes_runtime($new_setting); 替换成: ini_set("magic_quotes_runtime", $new_settin...

PHP中数组合并的两种方法及区别介绍

PHP数组合并两种方法及区别 如果是关联数组,如下: 复制代码 代码如下: $a = array( 'where' => 'uid=1', 'order' => 'uid',...