6.0.0-beta1
7/18/25

[#9180] georeferenced photo upload has wrong decimal separator in longitude
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

History
09/08/2010 05:37:17 PM Michael Rubinsky Comment #15
State ⇒ Resolved
Reply to this comment
Should be fixed now.
09/08/2010 05:02:24 PM CVS Commit Comment #14 Reply to this comment
Changes have been made in CVS for this ticket:

Ensure lat/lng values remain as doubles
Bug: 9180
http://cvs.horde.org/diff.php/ansel/lib/Exif.php?rt=horder1=1.41.2.12r2=1.41.2.13ty=u
08/20/2010 12:43:59 AM Michael Rubinsky Comment #13 Reply to this comment
This is fixed, though in Horde 4 only right now. The exif code was 
completely rewritten in Horde 4, so I still need to trace where this 
is happening in Horde 3.
08/20/2010 12:43:02 AM Git Commit Comment #12 Reply to this comment
Changes have been made in Git for this ticket:

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: 9180

http://git.horde.org/diff.php/framework/Image/lib/Horde/Image/Exif/Base.php?rt=horde-git&r1=3d36d1f649d343aac2c5a91a45de33e38456ae78&r2=f8c3e5f348ebd61023964d43c380bfce4630c8ef
08/18/2010 08:28:40 AM mmartin (at) mnet-online (dot) de Comment #11 Reply to this comment
it's definitive a locale issue:
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"]


08/18/2010 07:46:19 AM mmartin (at) mnet-online (dot) de Comment #10 Reply to this comment
In Ansel/lib/Exif.php, in the function _parseGPSData (should be 
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.
i even get before the SQL Update:
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?


08/18/2010 07:15:08 AM mmartin (at) mnet-online (dot) de Comment #9 Reply to this comment
In Ansel/lib/Exif.php, in the function _parseGPSData (should be 
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.
my local should be german, i did some debug logging:
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)


08/17/2010 08:49:36 PM Michael Rubinsky Comment #8 Reply to this comment
In Ansel/lib/Exif.php, in the function _parseGPSData (should be 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.


08/17/2010 03:45:51 PM Michael Rubinsky Comment #7
Assigned to Michael Rubinsky
State ⇒ Assigned
Reply to this comment
This image imports fine for me both with and without exif extension enabled:

56° 48' 29.30" N 6° 10' 46.91" W

Possibly a locale difference, I'll look and see what I can find.
08/17/2010 03:37:46 PM mmartin (at) mnet-online (dot) de Comment #6
New Attachment: P1000474.JPG Download
Reply to this comment
Can you upload an image that this is happening with? Also, does your
PHP have the exif extension installed?
Yes, one (big) example attached :-)
Hm. Nothing attached, maybe a size limit on the server. Can you try 
with a smaller image?
ok
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


08/17/2010 03:28:52 PM Michael Rubinsky Comment #5 Reply to this comment
Can you upload an image that this is happening with? Also, does your
PHP have the exif extension installed?
Yes, one (big) example attached :-)
Hm. Nothing attached, maybe a size limit on the server. Can you try 
with a smaller image?
08/17/2010 03:28:10 PM Michael Rubinsky Comment #4 Reply to this comment
Can you upload an image that this is happening with? Also, does your
PHP have the exif extension installed?
Yes, one (big) example attached :-)

No, i dont think so,
ansel/test.php says:
PEAR Modules
Can you instead check your phpinfo? I don't think it's checked for in 
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).


08/17/2010 03:16:20 PM mmartin (at) mnet-online (dot) de Comment #3 Reply to this comment
Can you upload an image that this is happening with? Also, does your 
PHP have the exif extension installed?
Yes, one (big) example attached :-)

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

08/17/2010 03:04:59 PM Michael Rubinsky Comment #2
State ⇒ Feedback
Reply to this comment
Can you upload an image that this is happening with? Also, does your 
PHP have the exif extension installed?
08/17/2010 12:09:08 PM mmartin (at) mnet-online (dot) de Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ georeferenced photo upload has wrong decimal separator in longitude
Type ⇒ Bug
Queue ⇒ Ansel
Reply to this comment
when uploading a georeferenced photo, the lattitude is importet with 
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

Saved Queries