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 file_get_contents取文件中数组元素的方法

用file_get_contents()抓取了 这个网址上的内容 http://simonfenci.sinaapp.com/index.php?key=simon&wd=131...

推荐学习php sesson的朋友必看PHP会话(Session)使用入门第1/2页

 由于 Session 是以文本文件形式存储在服务器端的,所以不怕客户端修改 Session 内容。实际上在服务器端的 Ses...

PHP中替换换行符的几种方法小结

第一种:复制代码 代码如下: <?php ?$str="this is a test \n"; $patten = array("\r\n", "\n", "\r"); ?//先替...

常用的php ADODB使用方法集锦

复制代码 代码如下:<?php        //定义数据库变量   ...