#39617 [Asn->Fbk]: Erroneously uses the GPS version tag to determine byte order of GPS fields
| From: | helly@php.net | Date: | Sat, 25 Nov 2006 15:21:10 +0000 |
| Subject: | #39617 [Asn->Fbk]: Erroneously uses the GPS version tag to determine byte order of GPS fields | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-105437@lists.php.net to get a copy of this message | ||
ID: 39617
Updated by: helly@php.net
Reported By: me+php at drbeat dot li
-Status: Assigned
+Status: Feedback
Bug Type: EXIF related
Operating System: Debian unstable (sid)
PHP Version: 4.4.4
Assigned To: helly
New Comment:
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
Your file is not available, please provide it.
Previous Comments:
------------------------------------------------------------------------
[2006-11-24 16:16:43] me+php at drbeat dot li
BTW, this image was resized in Apple's iPhoto.
------------------------------------------------------------------------
[2006-11-24 13:19:02] me+php at drbeat dot li
Description:
------------
When reading GPS EXIF tags, PHP seems to use the GPS version tag to
determine the byte order of the other GPS tags instead of the byte
order indicator from the EXIF header. An image that shows the incorrect
behavior is at http://www.drbeat.li/test/testgps.jpg .
In this picture, the GPS tag version is stored as the bytes [0, 0, 2,
2] instead of as [2, 2, 0, 0]. exif_read_data() consequently returns
wrong fractions for latitude, longitude and altitude.
Reproduce code:
---------------
if (($exif = @exif_read_data($file, 0, true)) !== false &&
$exif['GPS'])
print_r($exif['GPS']);
Expected result:
----------------
Array
(
[GPSVersion] => ????
[GPSLatitudeRef] => N
[GPSLatitude] => Array
(
[0] => 47/1
[1] => 8/1
[2] => 96/25
)
[GPSLongitudeRef] => E
[GPSLongitude] => Array
(
[0] => 7/1
[1] => 13/1
[2] => 60801/1250
)
[GPSAltitudeRef] => ?
[GPSAltitude] => 436/1
)
Actual result:
--------------
Array
(
[GPSVersion] => ????
[GPSLatitudeRef] => N
[GPSLatitude] => Array
(
[0] => 196608/3276800
[1] => 65536/2004877312
[2] => 57999413/-1526726656
)
[GPSLongitudeRef] => E
[GPSLongitude] => Array
(
[0] => 38666275/3080192
[1] => 65536/524288
[2] => 65536/6291456
)
[GPSAltitudeRef] => ?
[GPSAltitude] => 1638400/458752
)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39617&edit=1