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 rsa 加密,解密,签名,验签详解

php rsa 加密,解密,签名,验签 由于对接第三方机构使用的是Java版本的rsa加解密方法,所有刚开始在网上搜到很多PHP版本的rsa加解密,但是对接java大多都不适用。 以下p...

PHP常用函数小技巧

1. 返回文件扩展名 function getformat($file) { $ext=strrchr($file,"."); $format=strtolower($ext); ret...

PHP使用DOM对XML解析处理操作示例

PHP使用DOM对XML解析处理操作示例

本文实例讲述了PHP使用DOM对XML解析处理操作。分享给大家供大家参考,具体如下: DOM(Document Object Model):文档对象模型。核心思想是:把 xml文件看作是...

php生成zip压缩文件的方法详解

复制代码 代码如下:require_once "./include/zip.php"; $zip = new PHPZip(); //$zip -> createZip("要压缩的...

几行代码轻松实现PHP文件打包下载zip

本文实例为大家分享了PHP文件打包下载zip的具体代码,供大家参考,具体内容如下 <?php //获取文件列表 function list_dir($dir){...