PHP gets the EXIF information of the picture through the Exif_read_data function, _php tutorial

Source: Internet
Author: User

PHP uses the Exif_read_data function to obtain the EXIF information of the image,


PHP gets the EXIF information of the picture, PHP comes with a exif_read_data function that can be used to read the EXIF information of the picture, the code from the PHP manual

<?phpecho "Test1.jpg:
\ n "; $exif = Exif_read_data (' tests/test1.jpg ', ' IFD0 '); Echo $exif ===false? "No header data found.
\ n ":" Image contains headers
\ n "; $exif = Exif_read_data (' tests/test2.jpg ', 0, true); echo "Test2.jpg:
\ n "; foreach ($exif as $key = + $section) { foreach ($section as $name + $val) { echo" $key. $name: $val
\ n "; }}? >

The output is as follows

Test1.jpg:No Header Data Found.test2.jpg:FILE. Filename:test2.jpgfile.filedatetime:1017666176file. Filesize:1240file. Filetype:2file. Sectionsfound:any_tag, IFD0, THUMBNAIL, commentcomputed.html:width= "1" height= "1" COMPUTED. Height:1computed. Width:1computed. Iscolor:1computed. Byteordermotorola:1computed. Usercomment:exif Test Image.COMPUTED.UserCommentEncoding:ASCIICOMPUTED. Copyright:photo (c) M.boerger, edited by M.boerger.computed.copyright.photographer:photo (c) m. BoergerCOMPUTED.Copyright.Editor:Edited by M.boerger.ifd0.copyright:photo (c) m.boergerifd0.usercomment: Asciithumbnail. Jpeginterchangeformat:134thumbnail. Jpeginterchangeformatlength:523comment.0:comment #1. Comment.1:comment #2. Comment.2:comment # 3endthumbnail.jpeginterchangeformat:134thumbnail. Thumbnail.height:1thumbnail. Thumbnail.height:1

The above mentioned is the whole content of this article, I hope you can like.

http://www.bkjia.com/PHPjc/1003997.html www.bkjia.com true http://www.bkjia.com/PHPjc/1003997.html techarticle PHP through the Exif_read_data function to obtain the EXIF information of the picture, PHP gets the EXIF information of the picture, PHP comes with a exif_read_data function can be used to read the image of EXIF information, code from the PHP hand ...

  • 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.