|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-01-04 17:55 UTC] skinny dot bravo at gmail dot com
Description: ------------ PHP fails reading GPS data from a given set of photos from Samsung SGH- i900. The images are said to come from the camera without any edits. Ex: http://o1.imgsrc.ru/v/vahmurka/3/16095163cDU.jpg http://o1.imgsrc.ru/v/vahmurka/1/16095161rno.jpg exiftool 8.00 has no problem reading this file. php5.2-201001041530 produces the same result. Reproduce code: --------------- # php -r 'var_dump(read_exif_data("16095163cDU.jpg",NULL,TRUE));' Expected result: ---------------- ... ["SectionsFound"]=> string(35) "ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS" ... ["GPS"]=> array(8) { ["GPSVersion"]=> string(4) "" ["GPSLatitudeRef"]=> string(1) "N" ["GPSLatitude"]=> array(3) { [0]=> string(4) "43/1" [1]=> string(4) "16/1" [2]=> string(11) "75363/10000" } ["GPSLongitudeRef"]=> string(1) "E" ["GPSLongitude"]=> array(3) { [0]=> string(4) "77/1" [1]=> string(4) "21/1" [2]=> string(11) "140249/2629" } ["GPSAltitudeRef"]=> string(1) "" ["GPSAltitude"]=> string(6) "1603/1" ["GPSMapDatum"]=> string(6) "WGS-84" } these results are taken after fixing image with exiftool: # exiftool -all= -tagsfromfile @ -all:all -unsafe 16095163cDU.jpg Actual result: -------------- Warning: read_exif_data(16095163cDU.jpg): Illegal IFD offset in Command line code on line 1 array(4) { ["FILE"]=> array(6) { ["FileName"]=> string(15) "16095163cDU.jpg" ["FileDateTime"]=> int(1259257839) ["FileSize"]=> int(938692) ["FileType"]=> int(2) ["MimeType"]=> string(10) "image/jpeg" ["SectionsFound"]=> string(19) "ANY_TAG, IFD0, EXIF" } Patches30Jan2011_50660_exif_c.diff (last revision 2011-01-31 06:30 UTC by mjk at emmjaykay dot org)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 15:00:01 2025 UTC |
This issue exists on PHP version 5.6.27 on Mac OS X via MacPorts. I can vouch for the images coming off directly from the camera. Other programs (Photoshop, Lightroom, Preview) can read EXIF data just fine off the same files. Warning: read_exif_data(IMG_8456.JPG): IFD data bad offset: 0xFFFFFC72 length 0x1E68 in {php script file}