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 命名空间实例说明

复制代码 代码如下:namespace bak\ba\ba; function bab(){ echo "bi"; } namespace kkk; function k1(){ ech...

WordPress中获取页面链接和标题的相关PHP函数用法解析

get_permalink()(获取文章或页面链接) get_permalink() 用来根据固定连接返回文章或者页面的链接。在获取链接时 get_permalink() 函数需要知道要...

php版交通银行网银支付接口开发入门教程

本文实例讲述了php版交通银行网银支付接口实现方法。分享给大家供大家参考,具体如下: 概述:网银支付接口 和支付宝接口大体上差不多,主要的区别是 交通银行提供的 接口核心的比如,加密等是...

使用GD库生成带阴影文字的图片

使用GD库生成带阴影文字的图片

最近使用GD库来进行微信公共账号的图片生成,研究了一下GD库文字阴影效果的生成同时也发现了GD库的强大。 GD库,是php处理图形的扩展库,GD库提供了一系列用来处理图片的API,使用G...

php 冒泡排序 交换排序法

复制代码 代码如下: $a=array('11','2','13','4','22'); $num = count($a); for($i=0;$i<$num;$i++){ for...