php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73115 exif_read_data triggers warning on reading binary strings
Submitted: 2016-09-19 15:12 UTC Modified: 2017-07-09 15:50 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: lee dot traynor at skeptic dot de Assigned: kalle (profile)
Status: Closed Package: EXIF related
PHP Version: 7.0.11 OS: Windows 10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lee dot traynor at skeptic dot de
New email:
PHP Version: OS:

 

 [2016-09-19 15:12 UTC] lee dot traynor at skeptic dot de
Description:
------------
On encountering a binary string in exif data (e.g. makernote) exif_read_data () terminates reading, returns the exif tags successfully read and issues a warning about unreadable data. This does not occur in php <= 5.6.16, where the full set of exif tags is returned without warning. This bug may be related to Bug #72819 EXIF thumbnails not read anymore.

Test script:
---------------
exif_read_data ("img_0001.jpg");

Expected result:
----------------
All exif tags returned without error.

Actual result:
--------------
Only exif tags prior to "makernote" (which is a binary string) are returned and a warning issued.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-09-20 13:27 UTC] kalle@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: kalle
 [2017-07-07 10:32 UTC] kalle@php.net
-Status: Assigned +Status: Feedback
 [2017-07-07 10:32 UTC] kalle@php.net
Hi

Could you please provide me with a test image?

Thanks
 [2017-07-07 15:23 UTC] lee dot traynor at skeptic dot de
-Status: Feedback +Status: Assigned
 [2017-07-07 15:23 UTC] lee dot traynor at skeptic dot de
Try this image:

http://www.skeptic.de/blog/kvi/IMG_0001_D.JPG

I get:

PHP Warning:  exif_read_data(IMG_0001_D.JPG): IFD data bad offset: 0xFFFFFCAC length 0x08C8
 [2017-07-08 01:00 UTC] kalle@php.net
Thank you very much Lee, I do some testings with this one!
 [2017-07-08 01:33 UTC] kalle@php.net
-Status: Assigned +Status: Closed
 [2017-07-08 01:33 UTC] kalle@php.net
I can confirm that this bug has been fixed by recent patches to the EXIF extension! I added a test case for this to php-src:

http://git.php.net/?p=php-src.git;a=commit;h=469206c84e502e3e349655b802899d5e4d560f72
 [2017-07-09 15:43 UTC] lee dot traynor at skeptic dot de
-Status: Closed +Status: Assigned
 [2017-07-09 15:43 UTC] lee dot traynor at skeptic dot de
Sorry, I am still getting the exact same error message on PHP 7.0.21.
 [2017-07-09 15:50 UTC] kalle@php.net
-Status: Assigned +Status: Closed
 [2017-07-09 15:50 UTC] kalle@php.net
That is true, these changes are currently only in the 7.2 branch, I'm not sure if these changes can all be safely ported to 5.6/7.0/7.1 as there have been many changes to the exif extension recently. I will try to investigate further
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 09:01:28 2025 UTC