php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50845 exif_read_data() returns corrupted exif headers
Submitted: 2010-01-26 10:53 UTC Modified: 2010-01-26 11:05 UTC
Votes:11
Avg. Score:4.6 ± 0.8
Reproduced:9 of 10 (90.0%)
Same Version:8 (88.9%)
Same OS:7 (77.8%)
From: zerkella at i dot ua Assigned:
Status: Closed Package: EXIF related
PHP Version: 5.*, 6 OS: *
Private report: No CVE-ID: None
 [2010-01-26 10:53 UTC] zerkella at i dot ua
Description:
------------
exif_read_data returns bad values for headers for some photos. Headers look like corrupted during extraction from file - like they were mixed with and overwritten by other exif headers.

I tried to check Exif headers for same photos with XnView - it shows them nicely. So the problem is somewhere in php.

Files to reproduce this bug:
http://i.i.ua/php_bugs/62418.jpg
http://i.i.ua/php_bugs/39908.jpg
http://i.i.ua/php_bugs/21260.jpg


Reproduce code:
---------------
var_dump(exif_read_data('http://i.i.ua/php_bugs/62418.jpg', 'EXIF'));


var_dump(exif_read_data('http://i.i.ua/php_bugs/39908.jpg', 'EXIF'));

Expected result:
----------------
array(34) {
...
  ["Make"]=> string(11) "FUJI PHOTO FILM CO., LTD."
  ["Model"]=> string(7) "SLP800"
...
  ["Software"]=>  string(3) "FDi V4.5 / FRONTIER330-3.0-0E-5"
...
  ["DateTimeOriginal"]=> string(11) "2005:08:04 12:05:55"
...
}


array(49) {
...
  ["ApertureFNumber"]=> string(12) "f8.0"
...
  ["Make"]=> string(4) "Canon"
  ["Model"]=> string(2) "Canon EOS DIGITAL REBEL"
...
  ["ExposureTime"]=> string(13) "6250/1000000"
  ["FNumber"]=> string(13) "8.0"
  ["DateTimeOriginal"]=> string(19) "2005:05:14 19:00:41"
...
}





Actual result:
--------------
array(34) {
...
  ["Make"]=> string(11) "04 12:05:55"
  ["Model"]=> string(7) "M CO., "
...
  ["Software"]=>  string(3) "TD."
...
  ["DateTimeOriginal"]=> string(11) "-3.0-0E-518"
...
}


array(49) {
...
  ["ApertureFNumber"]=> string(12) "f/74099368.0"
...
  ["Make"]=> string(4) "Exif"
  ["Model"]=> string(2) "I*"
...
  ["ExposureTime"]=> string(13) "1111490560/15"
  ["FNumber"]=> string(13) "1111490560/15"
  ["DateTimeOriginal"]=> NULL
...
}





Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-17 08:43 UTC] steinsplitter-wiki at live dot com
only for the record: https://phabricator.wikimedia.org/T97253
 [2016-06-14 17:51 UTC] stas@php.net
Automatic comment on behalf of matma.rex@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1ab5a1b432a4b4c62171864bd1b545616e1b07db
Log: Fix #50845: exif_process_IFD_TAG: Use the right offset if reading from stream
 [2016-06-14 17:51 UTC] stas@php.net
-Status: Open +Status: Closed
 [2016-06-22 05:58 UTC] krakjoe@php.net
Automatic comment on behalf of matma.rex@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=1ab5a1b432a4b4c62171864bd1b545616e1b07db
Log: Fix #50845: exif_process_IFD_TAG: Use the right offset if reading from stream
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC