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给一组指定关键词添加span标签的方法

本文实例讲述了php给一组指定关键词添加span标签的方法。分享给大家供大家参考。具体如下: 这里是php给一组指定的关键词添加span标签,高亮突出显示关键词 // Example...

php 获取远程网页内容的函数

<?php $curDomain = $_SERVER['HTTP_HOST']; $strHTML = file_get_contents('//www.jb51.net/Dom...

PHP常见的序列化与反序列化操作实例分析

本文实例讲述了PHP常见的序列化与反序列化操作。分享给大家供大家参考,具体如下: 1.概念 serialize() 把变量和它们的值编码成文本形式 unserialize() 恢复原先...

PHP 时间日期操作实战

常见常用的时间函数: 1.time(); //取得1970/1/1 00:00:00 到现在的总秒数 <?echo time();?> 2.mktime(); //设定时间...

PHP连接MSSQL2008/2005数据库(SQLSRV)配置实例

本文实例讲述了PHP连接MSSQL2008/2005数据库(SQLSRV)配置方法,分享给大家供大家参考。具体方法如下: PHP连接MSSQL2008/2005数据库与以往的连接mssq...