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程序设计有所帮助。

相关文章

隐藏X-Space个人空间下方版权方法隐藏X-Space个人空间标题隐藏X-Space个人空间管理版权方法

版权可以在css中设置隐藏. 由于文件被ZEND所以不能删除,也不建议删除. 1.隐藏X-Space个人空间下方版权方法 修改/css/space.css找到以下代码: /*页...

php 魔术方法使用说明

PHP5.0后,php面向对象提成更多方法,使得php更加的强大!! 一些在PHP叫魔术方法的函数,在这里介绍一下:其实在一般的应用中,我们都需要用到他们!!1.__construct(...

php根据日期显示所在星座的方法

本文实例讲述了php根据日期显示所在星座的方法。分享给大家供大家参考。具体实现方法如下: <?php function zodiac($DOB){ $DOB =...

php页面防重复提交方法总结

1、提交按钮置disabled       当用户提交后,立即把按钮置为不可用状态。这种用js来实现。   &nbs...

php文件上传类完整实例

本文实例讲述了php文件上传类。分享给大家供大家参考,具体如下: /** $file=new class_file($file_array,"flash/"); $file->...