php.net |  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
Votes:3
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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
37 + 22 = ?
Subscribe to this entry?

 
 [2007-06-20 12:37 UTC] frederic dot maziere1 at neuf dot fr
Description:
------------
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 : http://trekmaniac3.free.fr/Canaries2006/images/thumb/IMG_3801.jpg

FYI, xnview, robogeo (and others) are able to read and return correct GPS data from that file. The expected values are :
latitude=27?38'26.39"
longitude=17?58'49.93"

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:
---------------
$exif=exif_read_data('IMG_3801.jpg');
foreach ($exif as $key => $section) {
		print_r($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

GPSLongitude.0:285212672/16777216
GPSLongitude.1:973078528/16777216
GPSLongitude.2:837753660/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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-04 17:20 UTC] helly@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.3-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.3-win32-installer-latest.msi

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 12:01:29 2024 UTC