PHP through the Exif_read_data function to get pictures of EXIF information _php skills

Source: Internet
Author: User

PHP to get the image of EXIF information, PHP with a exif_read_data function can be used to read the image of EXIF information, code from the PHP manual

<?php
echo "test1.jpg:<br/>\n";
$exif = Exif_read_data (' tests/test1.jpg ', ' IFD0 ');
Echo $exif ===false? "No Header Data found.<br/>\n": "Image contains headers<br/>\n";
 
$exif = Exif_read_data (' tests/test2.jpg ', 0, true);
echo "Test2.jpg:<br/>\n";
foreach ($exif as $key => $section) {
  foreach ($section as $name => $val) {
    echo $key. $name: $val <br/&G T;\n ";
  }
}
? >

The output is as follows

Test1.jpg:
No header data found.
Test2.jpg:
FILE. FileName:test2.jpg
FILE. filedatetime:1017666176
FILE. filesize:1240
FILE. Filetype:2
FILE. Sectionsfound:any_tag, IFD0, THUMBNAIL, COMMENT
computed.html:width= "1" height= "1"
computed. Height:1
computed. Width:1
computed. Iscolor:1
computed. Byteordermotorola:1
computed. Usercomment:exif test image.
Computed. Usercommentencoding:ascii
computed. Copyright:photo (c) M.boerger, edited by M.boerger.
Computed. Copyright.Photographer:Photo (c) M.boerger
computed. Copyright.Editor:Edited by M.boerger.
IFD0. Copyright:photo (c) M.boerger
IFD0. Usercomment:ascii
THUMBNAIL. jpeginterchangeformat:134
THUMBNAIL. jpeginterchangeformatlength:523
comment.0:comment #1.
Comment.1:comment #2.
Comment.2:comment #3end
THUMBNAIL. jpeginterchangeformat:134
THUMBNAIL. Thumbnail.height:1
Thumbnail. Thumbnail.height:1

The above mentioned is the entire content of this article, I hope you can enjoy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.