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利用APC模块实现大文件上传进度条的方法

php 大文件带进度的上传,一直是一个令php程序员很苦恼的问题。查询baidu 、Google ,大体做带进度的上传方式为:flash+php,socket,apc+php等,下面我介...

php实现数据库的增删改查

php实现数据库的增删改查

1.查询: 数据的显示,这里就可以嵌入php来进行数据的输出 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitiona...

PHP实现的比较完善的购物车类

本文实例讲述了PHP实现的比较完善的购物车类。分享给大家供大家参考。具体实现方法如下: 前不久做到一个项目需要用到购物车,考虑到可能经常用到,所以把它封装成一个类,以便以后调用,感兴趣的...

解析PHP生成静态html文件的三种方法

本文将介绍Php 生成静态html文件的三种方法 。1,下面使用模版的一个方法!复制代码 代码如下:<?php $fp = fopen ("templets.html","a");...

php中用数组的方法设置cookies

复制代码 代码如下: <?php         function set_cronology($name,$value,$duration...