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类

一个正规的网站,在需要上传图片时,往往都会需要在图片上增加自己网站的LOGO水印。那么如何实现这一步骤呢?首先让我们来了解PHP图片加水印的原理。 通过判断文件类型建立图形,然后把其复制...

php header()函数使用说明

header()函数使用说明:   一、作用:   ~~~~~~~~~       &...

PHP常用日期加减计算方法实例小结

本文实例总结了PHP常用日期加减计算方法。分享给大家供大家参考,具体如下: PHP 标准的日期格式 date("Y-m-d H:i:s"); PHP 简单的日期加减计算 &...

Windows2003下php5.4安装配置教程(Apache2.4)

Windows2003下php5.4安装配置教程(Apache2.4)

直接配置php一直使用如同《【php】本地开发环境的部署与helloworld》的一键傻瓜包,被批为极度不专业,关键是这些一键傻瓜包LAMP的版本不好控制,端口什么的也不好调。曾经在Li...

用sql命令修改数据表中的一个字段为非空(not null)的语句

用sql命令修改数据表中的一个字段为非空(not null)的语句

ALTER TABLE table1 ALTER COLUMN [name] varchar(60) NULL; table1 表名 name 字段名 为什么加上[],因为na...