Home  >  Article  >  Backend Development  >  How to get Exif thumbnail in PHP, get exif thumbnail_PHP tutorial

How to get Exif thumbnail in PHP, get exif thumbnail_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:46:40847browse

How to get Exif thumbnails in PHP, get exif thumbnails

The example in this article describes how to get Exif thumbnails in PHP. Share it with everyone for your reference. The specific implementation method is as follows:

// 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';
}

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1031488.htmlTechArticleHow to get Exif thumbnails in PHP, get exif thumbnails. This article describes the method of getting Exif thumbnails in PHP. Share it with everyone for your reference. The specific implementation method is as follows: // file to...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn