From:             me+php at drbeat dot li
Operating system: Debian unstable (sid)
PHP version:      4.4.4
PHP Bug Type:     EXIF related
Bug description:  Erroneously uses the GPS version tag to determine byte order 
of GPS fields

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 bug report at http://bugs.php.net/?id=39617&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39617&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39617&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39617&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39617&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39617&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39617&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39617&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39617&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39617&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39617&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39617&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39617&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39617&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39617&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39617&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39617&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39617&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39617&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39617&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39617&r=mysqlcfg

Reply via email to