|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41748 exif_read_data returns corrupted GPS data
Submitted: 2007-06-20 12:37 UTC Modified: 2008-02-12 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: frederic dot maziere1 at neuf dot fr Assigned: helly (profile)
Status: No Feedback Package: EXIF related
PHP Version: 5.2.3, 4.4.7 OS: W2000 and WXP
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: frederic dot maziere1 at neuf dot fr
New email:
PHP Version: OS:


 [2007-06-20 12:37 UTC] frederic dot maziere1 at neuf dot fr
While it works on many files exif_read_data returns corrupted GPS data on others.

exif_read_data returns bad latitude and longitude values for the following file :

FYI, xnview, robogeo (and others) are able to read and return correct GPS data from that file. The expected values are :

When analyzing the data returns by exif_read_data, it looks like there's a 3 value shift in the array of the rational values returned.

This problem occurs in every php version I tried : 4.3.10 or 5.2.0

Reproduce code:
foreach ($exif as $key => $section) {
    foreach ($section as $name => $val) {
        echo "$key.$name: $val<br />\n"; 

Expected result:
GPSLatitude.0: 452984832/16777216
GPSLatitude.1: 637534208/16777216
GPSLatitude.2: 442812995/16777216



Actual result:
GPS tags returned :

GPSLatitude.0: 542065991/808334710
GPSLatitude.1: 3224110/452984832
GPSLatitude.2: 16777216/637534208
GPSLongitude.0: 16777216/442812995
GPSLongitude.1: 16777216/285212672
GPSLongitude.2: 16777216/973078528
GPSTimeStamp.0: 16777216/837753660
GPSTimeStamp.1: 16777216/9
GPSTimeStamp.2: 1/49


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-04 17:20 UTC]
Please try using this CVS snapshot:
For Windows (zip):

For Windows (installer):

There is indeed an issue. Can you update from cvs (5.3 or HEAD) and try again please? 
 [2008-02-12 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Sep 28 09:03:42 2022 UTC