[Maps module] Importing EXIF data

andersh

Joined: 2005-08-27
Posts: 6
Posted: Wed, 2006-09-06 17:39

I have a problem with the Google Maps module. I'm running Gallery 2.1.2 and installed the current version (0.5.1d) og the module.

When I then updated the GPS info from the EXIF in my current images, I noticed that the position got mixed up. Even though my images had tags with Latitude=S and Longitude=E, the images showed up with Latitude=N and Longitude=W. This of course caused the images to be shown in the wrong place on the map. Needless to say the EXIF info is correct and work ok in other applications.

I then decided to try the latest release from 'svn' and downloaded and installed it (it says version 0.5.2a). When I now populate from Exif (in the maintenance menu) I see that the latitude/longitude problem seem to be fixed. But the resulting position contain commas instead of points as decimal separator. Eg.:

'-3,24249444444,37,5177277778'
instead of
'-3.24249444444,37.5177277778'

This cause Google Maps to hang with a script error when loading in the browser. Manually changing the commas to points solves the problem (but it is a hassle for 100+ images).

Trying the 'Google Map' tab from the 'edit item' page, I get the same result (commas) when I select 'Get via EXIF Infos'. But here I'm not able to save the coords unless I manually change the commas to points.

I assume that this might be due to my locale using commas for decimal point, but it still must be a bug. Any suggestions as to how to fix this?

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Wed, 2006-09-06 18:43

Yes, it is due to the locale ... I need to think of something smart to get that resolved.

I may simply add a search and replace '," for "." just in case or maybe look into gallery lcoalization, to see if anything can be done there.

I will post a fix to SVN tonight and let you know when it's available, sorry about that :-)

-------------------------
The Termite - :-) - http://perso.mine.nu/

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 26097
Posted: Wed, 2006-09-06 18:59

I bet it is a locale issue as well.
I though that there was a issue with the EXIF module as well, doing the reversal, but can't remember. I wish the search was working. I thought that Termite found the issue and it was fixed.

Termite, this might be of some help if it is a locale issue:
http://gallery.menalto.com/node/53715

Dave

____________________________________________________
Blog with G2 || Gallery Frames / Mods || G1 Test Gallery

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 26097
Posted: Wed, 2006-09-06 19:00

beet me to the punch
____________________________________________________
Blog with G2 || Gallery Frames / Mods || G1 Test Gallery

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Wed, 2006-09-06 19:10

Thx for the link Floridave, I will look into gallery utility tonight and add the right function to prevent that "." problem :-)

See you !
-------------------------
The Termite - :-) - http://perso.mine.nu/

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Thu, 2006-09-07 01:36

Andersh

I have changed the function and committed to SVN. Let me know if there is still the same problem after that fix.

Thanks !
-------------------------
The Termite - :-) - http://perso.mine.nu/

 
andersh

Joined: 2005-08-27
Posts: 6
Posted: Thu, 2006-09-07 06:03
Termitenshort wrote:
I have changed the function and committed to SVN. Let me know if there is still the same problem after that fix.

Thanks for your very fast response.

I downloaded the fix and tried it out. I now get the longitude right, but I still have commas in the latitude. Eg.:

-3,24249444444,37.5177277778

Looking at the new code, I can't really see why it behaves this way since you're really changing the commas to dots for both. But maybe it makes sense to a more experienced programmer... :-)

Anyway, I did some more tests yesterday afternoon. If I change my language to English (it is normally Norwegian), everything works ok, so it's definitely a locale related problem.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Thu, 2006-09-07 06:13

Ok, I think I know why.

Can you try now, I've commited a new change :-). Let me know !

Thanks !

-------------------------
The Termite - :-) - http://perso.mine.nu/

 
andersh

Joined: 2005-08-27
Posts: 6
Posted: Thu, 2006-09-07 06:48
Termitenshort wrote:
Ok, I think I know why.

Can you try now, I've commited a new change :-). Let me know !

That seems to have solved the problem. Thanks.

One more thing. For the images that have EXIF info, I get a button "Write GPS to EXIF header". For some reason this button is not there for images that do not already have EXIF info. For me this does not make much sense, since it is for the latter case that I really would like to have this button...

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Thu, 2006-09-07 06:54

Lol ... yeah that sounds like a bug.

I'll take a look at this, it should be the other way around indeed :-)
-------------------------
The Termite - :-) - http://perso.mine.nu/

 
andersh

Joined: 2005-08-27
Posts: 6
Posted: Thu, 2006-09-07 07:02
Termitenshort wrote:
Lol ... yeah that sounds like a bug.

I'll take a look at this, it should be the other way around indeed :-)

Ok.
I just tried to write back GPS to EXIF on an image where the EXIF info was wrong. I then received an error message saying "GPS coordinate already exist in Header, nothing written to file". So currently the button does not seem to be able to do anything at all :-) It would be nice to be able to correct incorrect EXIF data as well.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Thu, 2006-09-07 07:10
andersh wrote:
Ok.
I just tried to write back GPS to EXIF on an image where the EXIF info was wrong. I then received an error message saying "GPS coordinate already exist in Header, nothing written to file". So currently the button does not seem to be able to do anything at all :-) It would be nice to be able to correct incorrect EXIF data as well.

Thanks for the feedback. I was abit scared with that functionality when I finally got it all figured out (took me 2 weeks) and so I had put lots of protection in place to prevent screwing up my few pictures that had GPS coords in them.

I'm still debating if I should remove that protection. Especially when I get the bulk-write to exif finished, then I wouldn't want to overwrite things maybe.

For the per-item I will put a warning message a the possibilty to force the coordinates in the file.

Thanks again !

-------------------------
The Termite - :-) - http://perso.mine.nu/

 
andersh

Joined: 2005-08-27
Posts: 6
Posted: Thu, 2006-09-07 07:26
Termitenshort wrote:
I'm still debating if I should remove that protection. Especially when I get the bulk-write to exif finished, then I wouldn't want to overwrite things maybe.

For the per-item I will put a warning message a the possibilty to force the coordinates in the file.

I completely agree with you on the bulk-write issue. By default it should only write EXIF info to those images without GPS info. Maybe you could add a separate option to force update of existing EXIF info, it could be useful if you had manually configured one or more albums and wanted to make sure that the EXIF is correct for all images.

But for single images it would be nice to be able to correct GPS info in the EXIF as well as the Gallery specific info. While you're editing single images, you probably know what you want when you press the button to update EXIF info.

(and for this testing I've got copies ready of all images, so I'm not afraid of messing up what is now in my Gallery :-) )

Again - thanks for your fast response.

 
Termitenshort
Termitenshort's picture

Joined: 2005-10-09
Posts: 1894
Posted: Thu, 2006-09-07 07:40

This makes sense to me.

Thanks again !

-------------------------
The Termite - :-) - http://perso.mine.nu/