#41748 [NEW]: exif_read_data returns corrupted GPS data

From: Date: Wed, 20 Jun 2007 12:37:57 +0000
Subject: #41748 [NEW]: exif_read_data returns corrupted GPS data
Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-3899@lists.php.net to get a copy of this message
From: frederic dot maziere1 at neuf dot fr Operating system: W2000 and WXP PHP version: 4.4.7 PHP Bug Type: PHP-GTK related Bug description: exif_read_data returns corrupted GPS data 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 bug report at http://bugs.php.net/?id=41748&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41748&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41748&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41748&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41748&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41748&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41748&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41748&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41748&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41748&r=support Expected behavior: http://bugs.php.net/fix.php?id=41748&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41748&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41748&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41748&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41748&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41748&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41748&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41748&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41748&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41748&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41748&r=mysqlcfg

« previous php.gtk.dev (#3899) next »