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 tp验证表单与自动填充函数代码

复制代码 代码如下: <?php class FormModel extends Model { // 自动验证设置 /* * 一:自动验证 自动验证的定义是这样的:array(f...

PHP实现防盗链的方法分析

本文实例讲述了PHP实现防盗链的方法。分享给大家供大家参考,具体如下: $_SERVER['HTTP_REFERER']的获取情况 注意 $_SERVER['HTTP_REFERER']...

关于IIS php调用com组件的权限问题

1.运行Dcomcnfg.exe 2.组件服务――计算机――我的电脑 ――DCOM配置――找到microsoft word 文档 3.点击属性 4.选择“安全性” 5.选定“使用自定义访...

DISCUZ 论坛管理员密码忘记的解决方法

DISCUZ论坛管理员密码忘记了怎么办? 今天,一个朋友在QQ上问我,“如果DISCUZ论坛管理员密码忘记了 从MYSQL 哪里找啊?”, 他用的是HostMonster的虚拟主机。 y...

PHP实现AES256加密算法实例

本文实例讲述了PHP实现AES256加密算法的方法,是较为常见的一种加密算法。分享给大家供大家参考。具体如下: aes.class.php文件如下: <?php /*...