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简单判断文本编码的方法。分享给大家供大家参考。具体如下: 这里通过对文本的一次循环编码,来判断是否属于该编码。 public function chkCode($...

php文件包含的几种方式总结

php文件包含的几种方式总结

四种语句 PHP中有四个加载文件的语句:include、require、include_once、require_once。 基本语法 require:require函数一般放在PHP脚...

php读取html并截取字符串的简单代码

复制代码 代码如下:<?php $title='【宜配屋www.yipeiwu.com】'; $hello='jb51.net!'; $file=file_get_contents...

php限制上传文件类型并保存上传文件的方法

本文实例讲述了php限制上传文件类型并保存上传文件的方法。分享给大家供大家参考。具体如下: 下面的代码演示了php中如何获取用户上传的文件,并限制文件类型的一般图片文件,最后保存到服务器...

php中隐形字符65279(utf-8的BOM头)问题

今天在CSDN看到一个php输出空白隐形字符65279的问题,在网上找了下,发下这个65279字符是php用来标记文件是utf-8编码的,输出的时候会一起输出到客户端,导致客户端如果使用...