php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: junk at genokita dot net
New email:
PHP Version: OS:

 

 [2004-11-18 17:02 UTC] junk at genokita dot net
Description:
------------
Hi,
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:
http://www.genokita.net/a30284954ba1884666d8016f0448a644.jpg


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

 

Expected result:
----------------
..*snip*..
[GPSLongitude] => Array
(
  [0] => 139/1
  [1] => 42/1
  [2] => 0997/100
)
..*snip*..

Actual result:
--------------
..*snip*..
[GPSLongitude] => Array
(
  [0] => 139/1
  [1] => 42/1
  [2] => 997/100
)
..*snip*..



Patches

Pull Requests

History

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

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-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 10:01:27 2025 UTC