A-A+

PHP获取Exif缩略图的方法

2021年06月12日 我爱编程 暂无评论

这篇文章主要介绍了PHP获取Exif缩略图的方法,实例分析了php针对图片的读取及返回MIME类型的相关技巧,具有一定参考借鉴价值,需要的朋友可以参考下。

本文实例讲述了PHP获取Exif缩略图的方法,分享给大家供大家参考,具体实现方法如下:

  1. // file to read
  2. $file = 'test.jpg';
  3. $image = exif_thumbnail($file$width$height$type);
  4. // width, height and type get filled with data
  5. // after calling "exif_thumbnail"
  6. if ($image) {
  7.   // send header and image data to the browser:
  8.   header('Content-type: ' .image_type_to_mime_type($type));
  9.   print $image;
  10. }
  11. else {
  12.   // there is no thumbnail available, handle the error:
  13.   print 'No thumbnail available';
  14. }

给我留言

Copyright © 四季博客 保留所有权利.   Theme  Ality

用户登录