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函数实现判断是否移动端访问

忘记在哪里获取的函数了,刚才不了心在一个包里面找到,临时保存起来 复制代码 代码如下: /**  * 是否移动端访问访问  *  * @return boo...

WordPress主题制作中自定义头部的相关PHP函数解析

header_image() header_image() 函数是 WordPress 自定顶部图像的标准接口函数,该函数可以自动判断后台设置,并返回字符串形式的用户自定义顶部图像地址。...

PHP实现加密的几种方式介绍

PHP中的加密方式有如下几种 1. MD5加密 string md5 ( string $str [, bool $raw_output = false ] ) 参数 str ...

php chr() ord()中文截取乱码问题解决方法

复制代码 代码如下:<?php $lenth = 19; $str = "怎么将新闻的很长的标题只显示前面一些字,后面用.....来代替?"; echo strlen($str)&...

php模仿asp Application对象在线人数统计实现方法

本文实例讲述了php模仿asp Application对象在线人数统计实现方法。分享给大家供大家参考。具体实现方法如下: 复制代码 代码如下:/* 用法: application('...