#41748 [Opn]: exif_read_data returns corrupted GPS data
| From: | auroraeosrose@php.net | Date: | Wed, 20 Jun 2007 15:43:17 +0000 |
| Subject: | #41748 [Opn]: exif_read_data returns corrupted GPS data | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113968@lists.php.net to get a copy of this message | ||
ID: 41748
Updated by: auroraeosrose@php.net
Reported By: frederic dot maziere1 at neuf dot fr
Status: Open
-Bug Type: PHP-GTK related
+Bug Type: EXIF related
Operating System: W2000 and WXP
PHP Version: 4.4.7
New Comment:
Moved bug to right category
Previous Comments:
------------------------------------------------------------------------
[2007-06-20 12:37:57] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41748&edit=1