#39617 [Asn]: Erroneously uses the GPS version tag to determine byte order of GPS fields
| From: | me+php at drbeat dot li | Date: | Fri, 24 Nov 2006 16:16:44 +0000 |
| Subject: | #39617 [Asn]: 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-105419@lists.php.net to get a copy of this message | ||
ID: 39617
User updated by: me+php at drbeat dot li
Reported By: me+php at drbeat dot li
Status: Assigned
Bug Type: EXIF related
Operating System: Debian unstable (sid)
PHP Version: 4.4.4
Assigned To: helly
New Comment:
BTW, this image was resized in Apple's iPhoto.
Previous Comments:
------------------------------------------------------------------------
[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