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字符串逆序排列实现方法小结【strrev函数,二分法,循环法,递归法】

本文实例总结了PHP字符串逆序排列实现方法。分享给大家供大家参考,具体如下: 关于字符串的逆序排列,最简单的使用PHP函数strrev()的测试代码如下: header('Conte...

一键生成各种尺寸Icon的php脚本(实例)

实例如下: <?php /** * @name thumb 缩略图函数 * @param sting $img_name 图片路径 * @param...

使用PHP实现密保卡功能实现代码&amp;lt;打包下载直接运行&amp;gt;

使用PHP实现密保卡功能实现代码&amp;lt;打包下载直接运行&amp;gt;

效果图:密保卡入库 复制代码 代码如下: $this->load->model('admin/m_mibao'); $data = array(); //生成随机横坐标 $r...

PHP字符串处理的10个简单方法

1.确定一个字符串的长度 这是文章中最明显的一个例子,其中的问题是我们如何来确定一个字符串的长度,这里我们不能不提的就是strlen()函数: 复制代码 代码如下: $text = "s...

PHP实现上传多图即时显示与即时删除的方法

PHP实现上传多图即时显示与即时删除的方法

本文实例讲述了PHP实现上传多图即时显示与即时删除的方法。分享给大家供大家参考,具体如下: 就像这样的,每选择一个图片就会即时显示出来,附加到右边,也可以随意删除一个元素。 其实是,当...