php通過exif_read_data函數擷取圖片的exif資訊,_PHP教程

來源:互聯網
上載者:User

php通過exif_read_data函數擷取圖片的exif資訊,


php擷取圖片的exif資訊,php內建一個exif_read_data函數可以用來讀取圖片的exif資訊,代碼來自php手冊

<?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"; }}?>

輸出結果如下

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

以上所述就是本文的全部內容了,希望大家能夠喜歡。

http://www.bkjia.com/PHPjc/1003997.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1003997.htmlTechArticlephp通過exif_read_data函數擷取圖片的exif資訊, php擷取圖片的exif資訊,php內建一個exif_read_data函數可以用來讀取圖片的exif資訊,代碼來自php手...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.