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/** * 数据库备份还原类 * @author xialeistudio<admin@xialeistudio.net&g...

php常用hash加密函数

本文实例讲述了php常用hash加密函数。分享给大家供大家参考。具体分析如下: 复制代码 代码如下:$hash_list=hash_algos();  //返回注册的hash规...

调整优化您的LAMP应用程序的5种简单方法

调整优化您的LAMP应用程序的5种简单方法

简介 Wikipedia、Facebook 和 Yahoo! 等主要 web 属性使用 LAMP 架构来为每天数百万的请求提供服务,而 Wordpress、Joomla、Drupal 和...

php生成txt文件实例代码介绍

这是一个朋友过来的 php 生成 txt 文件代码,这只是一个实例,需要我来给他生成多个 txt 文件实例的,但我觉得他这个代码有点意思,所以就分享上来了。 先说下这个 php 生成 t...

PHP代码优化技巧小结

PHP代码优化技巧小结

PHP优化的目的是花最少的代价换来最快的运行速度与最容易维护的代码。给大家提供下面这些优化技巧: 1. echo 比 print 快。 2. 使用echo的多重参数代替字符串连接。 3...