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 //------------------------------------- // 文件说明:数学运算验证码 // 文件作者:Jesse Lee...

php数组遍历类与用法示例

本文实例讲述了php数组遍历类与用法。分享给大家供大家参考,具体如下: <?php class scanArray{ public $arr; pu...

在命令行下运行PHP脚本[带参数]的方法

创建一个简单的文本文件,其中包含有以下PHP代码,并把它保存为hello.php: 复制代码 代码如下: <?php echo "Hello from the CLI"; ?>...

php实现的RSS生成类实例

本文实例讲述了php实现的RSS生成类。分享给大家供大家参考。具体如下: class RSS { var $title; var $link; var $description...

PHP调用Webservice实例代码

它是一个开源软件,是完全采用PHP语言编写的、通过HTTP收发SOAP消息的一系列PHP类,由NuSphere Corporation(http://dietrich.ganx4.com...