|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30829 exif_read_data() returns wrong GPSLatitude and GPSLongitude
Submitted: 2004-11-18 17:02 UTC Modified: 2005-02-01 22:51 UTC
From: junk at genokita dot net Assigned:
Status: Not a bug Package: EXIF related
PHP Version: 5.0.2 OS: RedHatLinux9
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: junk at genokita dot net
New email:
PHP Version: OS:


 [2004-11-18 17:02 UTC] junk at genokita dot net
something wrong about returned value of exif_read_data(), includes "0"(zero) at the beginning of 3rd element at "GPSLatitude" and "GPSLongitude".

would you see sample code below, $exif_array['GPSLongitude'][2] is expected return '0997/100', but retuns '997/100' in some JPEG file. "zero" was missing. it's the same at "GPSLatitude".

sample jpg file:

Reproduce code:
print_r( exif_read_data($path_to_image, 'IDF0') );


Expected result:
[GPSLongitude] => Array
  [0] => 139/1
  [1] => 42/1
  [2] => 0997/100

Actual result:
[GPSLongitude] => Array
  [0] => 139/1
  [1] => 42/1
  [2] => 997/100


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-18 22:54 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

Integer data is read as integer thus leading 0s are removed.
 [2004-11-19 08:34 UTC] junk at genokita dot net
my fault. I forgot to check GPS IFD SPEC.
thx for your kindness.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Jun 26 01:03:36 2022 UTC