|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31797 exif_read_data reads very little data from what it used to read
Submitted: 2005-02-01 21:42 UTC Modified: 2005-02-02 00:29 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: shimi at shimi dot net Assigned: andrei (profile)
Status: Closed Package: EXIF related
PHP Version: 4CVS, 5CVS (2005-02-01) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: shimi at shimi dot net
New email:
PHP Version: OS:


 [2005-02-01 21:42 UTC] shimi at shimi dot net
I have a script that parses EXIF data from images, displaying them as a new image (using GD) that contains the data. Lately (I am not sure when exactly, but I suspect it was after upgrading to STABLE-CVS due to fixing of the unserialize() bug I suffered badly from), it seems that most of the important EXIF data is simply not read (like ExposureTime, etc). I asked someone to verify that the image indeed has the details, and it looks that it does. Here's a screenshot from his EXIF read:

Reproduce code:

Expected result:
See all EXIF data stored on file.

Actual result:
Only part of the EXIF is retrieved:
    [FileName] => 82728697.jpg
    [FileDateTime] => 1106515041
    [FileSize] => 102438
    [FileType] => 2
    [MimeType] => image/jpeg
    [SectionsFound] => ANY_TAG, IFD0
    [COMPUTED] => Array
            [html] => width="494" height="616"
            [Height] => 616
            [Width] => 494
            [IsColor] => 1
            [ByteOrderMotorola] => 0

    [ImageDescription] => OLYMPUS DIGITAL CAMERA         
    [Model] => C4100Z,C4000Z
    [XResolution] => 72/1
    [YResolution] => 72/1
    [ResolutionUnit] => 2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-01 21:52 UTC]
Add 'error_reporting(E_ALL);' to your script:

PHP Warning:  exif_read_data(82728697.jpg): corrupt EXIF header: maximum directory nesting level reached in Command line code on line 1

Corrupted image -> no bug in PHP.

 [2005-02-01 22:05 UTC] shimi at shimi dot net
I see him not wanting to nest further, thus deciding that "the header is bad". I tried it on numerous images, made by numerous cameras (Nikon, Sony, Olympus) - in all of them I get the same error, the image loads FINE, and other utilities (not PHP) _CAN_ read the missing data. PHP could read it too in the past. This code worked, and it has not been touched, and has now stopped working.

If you insist that the problem is on my end, can you please give me a URL that EXIF DOES parse the EXIF data for correctly?
 [2005-02-01 22:39 UTC]
This patch broke it:

revision date: 2005/01/21 23:47:06;  author: andrei;  state: Exp;  lines: +14 -2
Protect against corrupt EXIF headers that feature unlimited IFD tag nesting.

Assigned to the guilty one.. :)

 [2005-02-01 22:49 UTC] shimi at shimi dot net
moving to subcategory that was added just a few minutes ago (EXIF)
 [2005-02-02 00:29 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Jun 02 14:03:42 2023 UTC