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模拟asp中response类实现方法

本文实例讲述了PHP模拟asp中response类的方法。分享给大家供大家参考。具体如下: 习惯了asp或是asp.net开发的人, 他们会经常用到response类,这个类用于处理客户...

PHP,ASP.JAVA,JAVA代码格式化工具整理

PHP代码格式化工具http://www.waterproof.fr/products/phpCodeBeautifier/最近修改一个代码,里面完全没有缩进,用这个能够格式化一下。相当...

php源代码安装常见错误与解决办法分享

错误:configure: error: libevent >= 1.4.11 could not be found 解决:yum -y install libevent libe...

php+Memcached实现简单留言板功能示例

php+Memcached实现简单留言板功能示例

本文实例讲述了php+Memcached实现简单留言板功能。分享给大家供大家参考,具体如下: MyPdo.php <?php class MyPdo{ privat...

PHP里的$_GET数组介绍

在开发过程中,GET和POST无处不在。$_GET 变量是一个数组,内容是由 HTTP GET 方法发送的变量名称和值。 $_GET 变量用于收集来自 method="get" 的表单中...