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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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
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

Pull Requests

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: Sun Dec 22 06:01:30 2024 UTC