Summary | georeferenced photo upload has wrong decimal separator in longitude |
Queue | Ansel |
Queue Version | 1.1.1 |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | mrubinsk (at) horde (dot) org |
Requester | mmartin (at) mnet-online (dot) de |
Created | 08/17/2010 (5449 days ago) |
Due | |
Updated | 09/08/2010 (5427 days ago) |
Assigned | 08/17/2010 (5449 days ago) |
Resolved | 09/08/2010 (5427 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Resolved
Ensure lat/lng values remain as doubles
Bug: 9180http://cvs.horde.org/diff.php/ansel/lib/Exif.php?rt=horder1=1.41.2.12r2=1.41.2.13ty=u
completely rewritten in Horde 4, so I still need to trace where this
is happening in Horde 3.
Don't perform any string operations on the variable when we assume
it's the decimal value.
Just cast it outright, don't trim() or replace the ordinal indicators
if present, the
cast operation will do that for us, and as a bonus, won't corrupt the
value if it's in
a locale that doesn't use a decimal point for a decimal seperator.
Bug: 9180http://git.horde.org/diff.php/framework/Image/lib/Horde/Image/Exif/Base.php?rt=horde-git&r1=3d36d1f649d343aac2c5a91a45de33e38456ae78&r2=f8c3e5f348ebd61023964d43c380bfce4630c8ef
when i change my language to 'English (US)'
i can import correct:
Aug 18 10:24:43 HORDE [debug] [ansel] degtodecimal(56/1,48,29.3 is
56.808139. [pid 22789 on line 158 of
"/usr/share/psa-horde/ansel/lib/Exif.php"]
Aug 18 10:24:43 HORDE [debug] [ansel]
parsegpsdate(GPSLatitude,Array)=56.808139 [pid 22789 on line 101 of
"/usr/share/psa-horde/ansel/lib/Exif.php"]
Aug 18 10:24:43 HORDE [debug] [ansel] degtodecimal(6/1,10,46.91 is
6.179697. [pid 22789 on line 158 of
"/usr/share/psa-horde/ansel/lib/Exif.php"]
Aug 18 10:24:43 HORDE [debug] [ansel]
parsegpsdate(GPSLongitude,Array)=6.179697 [pid 22789 on line 101 of
"/usr/share/psa-horde/ansel/lib/Exif.php"]
Aug 18 10:24:43 HORDE [debug] [ansel] GPSLongitudeRef=W=-6.179697 [pid
22789 on line 105 of "/usr/share/psa-horde/ansel/lib/Exif.php"]
Aug 18 10:24:43 HORDE [debug] [ansel] SQL query by
Ansel_Tags::writeTags: INSERT INTO ansel_images_tags (image_id,
tag_id) VALUES(?, ?) [pid 22789 on line 71 of
"/usr/share/psa-horde/ansel\
/lib/Tags.php"]
Aug 18 10:24:43 HORDE [debug] [ansel] image 2838 save lat 56.808139
lng -6.179697 [pid 22789 on line 2370 of
"/usr/share/psa-horde/ansel/lib/Ansel.php"]
around line 131) - can you find out the value of $data, $min, and
$sec?
something like var_dump($data) etc... right before the return on line 152.
Aug 18 09:30:15 HORDE [debug] [ansel] image 2837 save lat 56,808139
lng -6,179697 [pid 330 on line 2370 of
"/usr/share/psa-horde/ansel/lib/Ansel.php"]
so the sql execute is converting one value and not the other?
since both are varchar in DB, i would expect both to contain , as separator?
around line 131) - can you find out the value of $data, $min, and
$sec?
something like var_dump($data) etc... right before the return on line 152.
Aug 18 08:54:21 HORDE [debug] [ansel] degtodecimal(56/1,48,29,3 is
56,808139. [pid 21431 on line 158 of
"/usr/share/psa-horde/ansel/lib/Exif.php"]
Aug 18 08:54:21 HORDE [debug] [ansel]
parsegpsdate(GPSLatitude,Array)=56,808139 [pid 21431 on line 101 of
"/usr/share/psa-horde/ansel/lib/Exif.php"]
Aug 18 08:54:21 HORDE [debug] [ansel] degtodecimal(6/1,10,46,91 is
6,179697. [pid 21431 on line 158 of
"/usr/share/psa-horde/ansel/lib/Exif.php"]
Aug 18 08:54:21 HORDE [debug] [ansel]
parsegpsdate(GPSLongitude,Array)=6,179697 [pid 21431 on line 101 of
"/usr/share/psa-horde/ansel/lib/Exif.php"]
Aug 18 08:54:21 HORDE [debug] [ansel] GPSLongitudeRef=W=-6,179697 [pid
21431 on line 105 of "/usr/share/psa-horde/ansel/lib/Exif.php"]
so i seem to have , as the decimal separator, but in the Lattitude
case that's correctly convertet to . whereas in the longitude case,
it's not ?!
Moreover both the attributes in ansel_image_attributes and the
image_longitude in ansel_image show the same behavior (lattitude ok,
longitude wrong)
line 131) - can you find out the value of $data, $min, and $sec?
something like var_dump($data) etc... right before the return on line 152.
Assigned to Michael Rubinsky
State ⇒ Assigned
56° 48' 29.30" N 6° 10' 46.91" W
Possibly a locale difference, I'll look and see what I can find.
New Attachment: P1000474.JPG
PHP have the exif extension installed?
with a smaller image?
exif is installed:
EXIF Support => enabled
EXIF Version => 1.4 $Id: exif.c,v 1.162.2.2 2004/11/10 01:44:28 iliaa Exp $
Supported EXIF Version => 0220
Supported filetypes => JPEG,TIFF
PHP have the exif extension installed?
with a smaller image?
PHP have the exif extension installed?
No, i dont think so,
ansel/test.php says:
PEAR Modules
Ansel's test. You can check by looking at horde/test.php then clicking
view phpinfo. See if there is a section titled "exif". (We don't
require the extension, as we have our own code to fall back on, but
this will help me determine which code to look at).
PHP have the exif extension installed?
No, i dont think so,
ansel/test.php says:
PEAR Modules
* PEAR Search Path (PHP's include_path):
/usr/share/psa-horde/lib:/usr/share/psa-horde:/usr/share/psa-horde/pear:.
* PEAR: Yes
* Recent PEAR: Yes
* MDB2: Yes
State ⇒ Feedback
PHP have the exif extension installed?
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ georeferenced photo upload has wrong decimal separator in longitude
Type ⇒ Bug
Queue ⇒ Ansel
52.12345 whereas the longitude is imported as -5,6789.
This leads to the maps api script to display the foto at longitude -5.0000