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中通过curl smtp发送邮件

先google了一下,发现很多问相关问题的但没有相关的解答,在phpclasses里也没有找到相关的类于是自己边看stmp的相关协议边开始尝试curl SMTP协议 这个在网上可以找到多...

PHP使用feof()函数读文件的方法

本文实例讲述了PHP使用feof()函数读文件的方法。分享给大家供大家参考。具体用法如下: feof应用于PHP 4, PHP 5 -用来测试文件指针是否到了文件结束的位置。 如果服务...

PHP 加密解密内部算法

将它们打包成一个文件就叫fun.php吧 复制代码 代码如下: <?php function passport_encrypt($txt, $key) { srand((doubl...

几个实用的PHP内置函数使用指南

几个实用的PHP内置函数使用指南

PHP有许多内置函数,其中大多数函数都被程序员广泛使用。但也有一些函数隐藏在角落,本文将向大家介绍7个鲜为人知,但用处非常大的函数。 没用过的程序员不妨过来看看。   1.highli...

理解PHP中的stdClass类

相信大家跟我一样,会经常看到和下面很类似的PHP代码: 复制代码 代码如下:$user = new stdClass();$user->name = 'gouki'; 这样的代码,...