php.net |  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
Votes:1
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
Status: Closed Package: EXIF related
PHP Version: 4CVS, 5CVS (2005-02-01) OS: *
Private report: No CVE-ID:
 [2005-02-01 21:42 UTC] shimi at shimi dot net
Description:
------------
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: http://uploaded.fresh.co.il/2005/02/01/76282133.png

Reproduce code:
---------------
$data=exif_read_data("http://uploaded.fresh.co.il/2005/01/23/82728697.jpg");
print_r($data);

Expected result:
----------------
See all EXIF data stored on file.

Actual result:
--------------
Only part of the EXIF is retrieved:
Array
(
    [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         
    [Make] => OLYMPUS OPTICAL CO.,LTD
    [Model] => C4100Z,C4000Z
    [XResolution] => 72/1
    [YResolution] => 72/1
    [ResolutionUnit] => 2
)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-01 21:52 UTC] sniper@php.net
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] sniper@php.net
This patch broke it:

revision 1.118.2.30 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] iliaa@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 21:01:56 2014 UTC