欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

PHP获取Exif缩略图的方法

程序员文章站 2022-06-03 15:45:44
本文实例讲述了php获取exif缩略图的方法。分享给大家供大家参考。具体实现方法如下: // file to read $file = 'test.jpg';...

本文实例讲述了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程序设计有所帮助。