Module: EXIF GPS
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
The EXIF_GPS module is a Gallery 3 module which will extract Latitude and Longitude information from a photos exif data. The data will be automatically extracted from photos as they're uploaded, if it's present. Additionally, a maintenance task is available to scan the entire Gallery 3 library for photos that were uploaded before this module is active, in order to extract GPS data from older pictures. This module also allows users to manually assign Latitude and Longitude values by using the edit menu option (Edit photo, Edit album, etc). The stored coordinates are then used to display a small google map in the sidebar, showing where the photo was taken. Also, for anyone using my TagsMap module, the sidebar is TagsMap aware -- in the event that the current item does not have exif coordinates associated with it, but does have a gps-tagged tag assigned to it, the coordinates from the tag will be used instead. [img]http://codex.gallery2.org/images/0/00/Exifgps.jpg[/img] ---
|
||||
josi-no
Joined: 2010-03-05
Posts: 7 |
![]() |
|||
The extracted coordinates I get are corrupted. The . (point) is replaced with , (comma). These coordinates: changes to this: Any idea why this happens? |
||||
josi-no
Joined: 2010-03-05
Posts: 7 |
![]() |
|||
If I change locale to US, then the picture files imported when US is default locale get correct coordinates. I don't know where the bug is, but when changing locale (to ex. no_NO), only the *shown* coordianates should use comma as decimal separator. The saved EXIF values should always remain decimal point. |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
josi-no wrote:
If I change locale to US, then the picture files imported when US is default locale get correct coordinates. I am unable to reproduce this bug on my test servers. The coordinates are stored with a "." regardless of the selected or default language. It may have something to do with the underlying server configuration, but I'm not sure. I've added a few extra lines of code that should replace any "," characters with "."'s to try and fix this. Let me know if this fixes it, as I can't test the fix myself. |
||||
josi-no
Joined: 2010-03-05
Posts: 7 |
![]() |
|||
It did the trick, it's working now! Thanks! |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
subscribe all the best |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
Does iPhone 3G s create GPS exif for photos taken by iP? Rwatcher: is it possible to join related modules into one? Exif, Exif_GPS, Tags, Tagsmap, Tag faces etc. This will provide a more smooth upgrading proces, one thread to keep track of and in time, integrated documentation, menu display in sidebar etc etc. I thought of activation, deactivation inside this complete module and maybe some doc inside admin to give people a clue. all the best |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
hebhansen wrote:
Does iPhone 3G s create GPS exif for photos taken by iP? I don't know, maybe? Give it a try and see. hebhansen wrote:
Rwatcher: is it possible to join related modules into one? Exif, Exif_GPS, Tags, Tagsmap, Tag faces etc. Short answer -- No. |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
iPhone users that use a non geotagging camera might want to have a look at this: I have requested this for windows. Note if you use windows, don't buy the app yet. I have requested this for windows and I will lt you know here. Didn't mean to advertise, but might be usefull info for some... all the best |
||||
CaptainRudi
Joined: 2006-07-06
Posts: 16 |
![]() |
|||
Great module and working like a charm ... Well done! I would love to see some more functionalities like in the old g2 gmaps module. Like a map showing all locations of the pics within an album or maybe the complete gallery - any chance with that ?! But thank you very much so far !!! |
||||
pinn8
Joined: 2009-02-19
Posts: 74 |
![]() |
|||
This is something I have been hoping to see appear for some time. Thanks for getting it started, rWatcher. I have a few suggestions for enhancements, if they are possible: |
||||
sddroog
Joined: 2005-02-01
Posts: 132 |
![]() |
|||
Thanks for this great module. I have a small problem however. I ran the "Extract Exif GPS data" maintenance task and all my European photos have the correct gps data loaded. However, I have a number of photos from New York, and the coordinates are wrong. For instance, I have a picture of the UN building in NY with coordinates of 40.750583333333,73.968572222222 instead of 40.750583333333,-73.968572222222. In the original picture there is a latitude ref. of "N" and a longitude ref. of "W". The European picture have "N" ad "E" respectively. The coordinates are positive numbers in both cases. |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
sddroog wrote:
Thanks for this great module. I have a small problem however. I ran the "Extract Exif GPS data" maintenance task and all my European photos have the correct gps data loaded. However, I have a number of photos from New York, and the coordinates are wrong. For instance, I have a picture of the UN building in NY with coordinates of 40.750583333333,73.968572222222 instead of 40.750583333333,-73.968572222222. In the original picture there is a latitude ref. of "N" and a longitude ref. of "W". The European picture have "N" ad "E" respectively. The coordinates are positive numbers in both cases. Would it be possible for you to post a sample photo with non-working coordinates? Lines 55-60 are supposed to account for negative coordinates, but I guess it's not working properly for some reason. |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
CaptainRudi wrote:
Great module and working like a charm ... Well done! I don't know, I'll have to take a look at how the g2 module works and go from there. pinn8 wrote:
This is something I have been hoping to see appear for some time. Thanks for getting it started, rWatcher. I have a few suggestions for enhancements, if they are possible: I didn't think standard controls were necessary for a sidebar, as there's only one point displayed on it. |
||||
cchiappa
![]()
Joined: 2008-08-11
Posts: 101 |
![]() |
|||
rWatcher wrote:
This would be great, it's one of the things I would really like to have before considering a change to G3. One thing to note tho is that while I love the G2 module's map of my images, it *really* bogs down when you get a couple of hundred geotagged images in an album (in part because it draws every single image on the map...picture 5000 pinpoints on a google map). I seem to recall that Coppermine's similar functionality is somewhat more reasonable and has a way of filtering close points to speed up the rendering...it might be worth taking a look at what it does (this is from meory, it has been a long time since I looked). Thanks a bunch for working on this! |
||||
pinn8
Joined: 2009-02-19
Posts: 74 |
![]() |
|||
@rWatcher -- I think the zoom in/out are useful because the map may be zoomed at an inappropriate level. For example, look at this link (http://pinnacle8.com/galleries/index.php/CanRock/Wilcox/IMG_5495) to a photo taken in Jasper National Park. The map shows a pink marker in a field of green. There is no context in this map, so it doesn't give the viewer any idea at all where it was taken. Perhaps it would make sense to make the map a link to a larger, full-control map on the Google Maps site. Regarding the header: I thought I saw an orphaned header while I was logged in yesterday, but I can't reproduce it today, so don't worry about it. |
||||
MtnBiker
Joined: 2008-02-11
Posts: 172 |
![]() |
|||
I second pinn8's suggestion (link to maps.google.com). I just installed with RC1 and only see the pink marker in a field of green. http://knobby.ws/gallery3/album/2007-05-19-at-13-47-48. (I'm not seeing the EXIF GPS module display for pinn8's example.) Great module. Glad to see GPS support for G3. |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
Module breakes G2 Import |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
Serge D wrote:
Module breakes G2 Import The module attaches itself to the item_created and item_deleted events (which G2 import must be invoking), so there isn't really any way for the module to distinguish between regular photo uploads and the G2 Import module. You could disable the exif gps module, run the G2 Import, then re-enable exif gps and run the maintenance option to scan your existing photos. |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
yes, this what I did. And by itself, it work just fine. Do we really need this process when we add items? would it be sufficient just to mark them for later processing? Actually I have submitted ticket to strip import process from any post processing tasks. If this is possible, it would speed up process and make it more protected. What would be also great if talmdal integrate part of your code in Exif code itself - see here. |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
Serge D wrote:
yes, this what I did. And by itself, it work just fine. Do we really need this process when we add items? would it be sufficient just to mark them for later processing?. I suppose that depends on how the Gallery is being used. The module scans photos on upload/import mostly because I modeled it after the EXIF module, and that's how it works. The only way I can think of to do "later processing" would be to flag photos in the database as "un-scanned" when they're uploaded, and then create a maintenance script for an admin to run to extract the coordinates. Personally, I think having the coordinates extracted immediately is a lot more convenient, especially if a Gallery has multiple non-admin users who would be stuck waiting for the admin to log in a click a scan button. |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
yes, this would be a case if I was not talking about Import 2 process. can I suggest the following change: In exif_gps_event.php static function item_edit_form($item, $form) { // Allow users to set / edit the GPS coordinates associated with the current item. $record = ORM::factory("exif_coordinate")->where("item_id", "=", $item->id)->find(); $gpsdata = $form->edit_item->group("gps_data")->label("GPS Data"); if ($record->loaded()) { $gpsdata->input("latitude")->label(t("Latitude")) ->value($record->latitude); $gpsdata->input("longitude")->label(t("Longitude")) ->value($record->longitude); } else { $gpsdata->input("latitude")->label(t("Latitude")); $gpsdata->input("longitude")->label(t("Longitude")); } } static function item_edit_form_completed($item, $form) { ... $record->latitude = $form->edit_item->gps_data->latitude->value; $record->longitude = $form->edit_item->gps_data->longitude->value; ... |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
Serge D wrote:
can I suggest the following change: Changed and committed to my github, thanks |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
Extracting exif data stalls photo 937 of 1104 and then nothing? In maintenance it displays as aktive task waiting to be completed... all the best |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
Did you try to resume the task? Maintenance scripts sometimes stall when dealing with a large number of photos. |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
FYI: I made a change to default Exif module to extract this info and it seems to be working fine - info was extracted and recorded as part of exif data. |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
I fully support bringing related smaller modules together. Otherwise we will end up having a new module for every codeline. Serge: if I understand you correct. The main tagsmodule now has this block inside? But only in your install. If there is a thread for that module, maybe you could up the code there and post alink here. all the best |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
My version of Exif module extracts GPS information now as well even without GPS Exif module. |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
Rwatcher: I have a number of tags where I defined location myself. Tags Module I guess. If geolocation is not in Image it grabs one of my definitions. What I do when tagging is starting from outside and moving in. Example Denmark - Copenhagen - National Museum In this example this module grabs the first it finds, being the least significant/precise. Can this be sorted in a clever way that I can't really think of right now? Btw. I tag outside Gallery, so that tags are in the Jpeg at import if that matters Tags created in G3 are they included in the jpeg file or is it lost if jpeg leaves G3? all the best |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
hebhansen wrote:
Rwatcher: I have a number of tags where I defined location myself. Tags Module I guess. If geolocation is not in Image it grabs one of my definitions. There's no way to distinguish one set of coordinates as being more significant then another. You can manually specify a set of coordinates using the edit photo dialog though. hebhansen wrote:
Tags created in G3 are they included in the jpeg file or is it lost if jpeg leaves G3? As far as I know, tags created in Gallery exist in Gallery's database only. Gallery does not store its tags in the actual photo. |
||||
hebhansen
![]()
Joined: 2009-02-10
Posts: 573 |
![]() |
|||
If possible to bring it to the file it would be a strong feature... Rebuilding a site with lost DB end tagging over would be one of the worst I can think of. also if lattitude and longitude could be returned to the file, could be strong all the best |
||||
sddroog
Joined: 2005-02-01
Posts: 132 |
![]() |
|||
rWatcher wrote:
Hi, I sent you a PM a few days back with a photo. Did you receive it? |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
sddroog wrote:
Hi, I sent you a PM a few days back with a photo. Did you receive it? Yes, this issue should now be fixed on my github. I'll post an updated .zip file here shortly. |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
EXIF_GPS version 2 is now available from this post, or from my github account. If you already had the previous version installed, you may need to run the Gallery 3 upgrader (example.com/gallery3/index.php/upgrader) after uploading this module. In this version: Notes: This has been tested against Gallery 3.0, RC1. |
||||
MtnBiker
Joined: 2008-02-11
Posts: 172 |
![]() |
|||
Thanks for supporting G3 and continuing updates. And thanks for the link to the file in your posting. Saves having to figure out where it lives. Now uploading: Greatly improved. Customization is great. And it came up hybrid by default which is probably a good choice since many photos are not near roads. One odd quirk. I can drag the little arrow key from the drop down menu. Safari and Firefox on a Mac. And Map This Album. A great feature. I haven't seen anything as well implemented as this. This feature could change how I organize some albums. One minor quibble, the cookie crumb link (is this the right term?) or some other direct way to get back to the album is missing. I see if you can get there by clicking on a pin and clicking on the photo. Something to think about if you love coding: At the album level show the map with pins for all the photos in the album. One difficulty could be nested albums. One last one: a pop-up in the admin panel to define the zoom level (or a link) or change to so many km by km or similar. I just tried to find out how to interpret the zoom level and on five different pages I didn't see anything that gets one where they need to be. I have so far found out 0 is coarse and 23 maybe the finest. So even that info would be helpful. Change the admin page to: Thanks for a great module. |
||||
pinn8
Joined: 2009-02-19
Posts: 74 |
![]() |
|||
@rWatcher -- Excellent! Thank you for your efforts on this module. |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
Nicely done! |
||||
huebi
Joined: 2008-03-03
Posts: 63 |
![]() |
|||
Is there a gallery on the web using this new version where i can have a look at? |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
Check this |
||||
josi-no
Joined: 2010-03-05
Posts: 7 |
![]() |
|||
This is just what I looked for. Thanks! |
||||
josi-no
Joined: 2010-03-05
Posts: 7 |
![]() |
|||
Looks like it's not possible to translate "Map this album" and "Map <name>'s photos". Or am I missing something? |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
@josi-no: yes, in exif_gps_maps_sidebar.html.php text is not wrapped in t() |
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
MtnBiker wrote:
Thanks for supporting G3 and continuing updates. And thanks for the link to the file in your posting. Saves having to figure out where it lives. Now uploading: I can reproduce this under windows with Safari as well, but it snaps back to where it is supposed to be once I release the mouse. I can also drag around the "Powered by Google" image as well, so I'm thinking this is probably how the browser is designed to work. MtnBiker wrote:
And Map This Album. A great feature. I haven't seen anything as well implemented as this. This feature could change how I organize some albums. One minor quibble, the cookie crumb link (is this the right term?) or some other direct way to get back to the album is missing. I see if you can get there by clicking on a pin and clicking on the photo. I can't use the "cookie crumb" links as they're not designed to be used outside of album/photo view pages. I have added a "Return to album" link below the map though. MtnBiker wrote:
Something to think about if you love coding: At the album level show the map with pins for all the photos in the album. One difficulty could be nested albums. I thought about doing this originally, but when an album has a lot of photos in it, it just becomes too many red markers on too small of a map. You can manually specify a single location to display via the Edit album dialog though. MtnBiker wrote:
One last one: a pop-up in the admin panel to define the zoom level (or a link) or change to so many km by km or similar. I just tried to find out how to interpret the zoom level and on five different pages I didn't see anything that gets one where they need to be. I have so far found out 0 is coarse and 23 maybe the finest. So even that info would be helpful. Change the admin page to: According to Google: Zoom level indices in GMap2 start with 0 at the coarsest level, not at the finest. This allows maps of arbitrarily high resolution, which will let us more easily introduce high resolution imagery. http://code.google.com/apis/maps/documentation/introduction.html Each map also contains a zoom level, which defines the resolution of the current view. Zoom levels between 0 (the lowest zoom level, in which the entire world can be seen on one map) to 19 (the highest zoom level, down to individual buildings) are possible within the normal maps view. Zoom levels vary depending on where in the world you're looking, as data in some parts of the globe is more defined than in others. Zoom levels up to 20 are possible within satellite view. So basically the upper limit depends on the map type, and changes occasionally when google decides to add more detailed imagery. I have now added some additional text to the bottom of the admin screen to provide a general idea of how the zoom level works, but you really just have to experiment with different values and see what looks best with the map type you're using and the area most of your photos were taken in. josi-no wrote:
Looks like it's not possible to translate "Map this album" and "Map <name>'s photos". Or am I missing something? Sorry, must have missed that one. Everything should be translatable now |
||||
floridave
![]()
Joined: 2003-12-22
Posts: 27300 |
![]() |
|||
rWatcher Dave |
||||
sddroog
Joined: 2005-02-01
Posts: 132 |
![]() |
|||
rWatcher wrote:
After clearing the exif_coordinates tabels and rescanning, all my items are being displayed correctly on the map now. Thanks a lot! And the new features are great to! |
||||
huebi
Joined: 2008-03-03
Posts: 63 |
![]() |
|||
I really enjoy this and its what i'm looking for. Tried out G2 with gmaps and it didnt work very well. But i cant find out how to set the zoom level for the "Map Album" feature, its always zoomed in at maximum and shows now pictures. Zoom level for individual picture are working well. Is it possible do define the zoom level for each album individual? |
||||
CaptainRudi
Joined: 2006-07-06
Posts: 16 |
![]() |
|||
Thank you so much for your hard work !!! This makes g3 so picasaweb However I would second the request of MtnBiker concerning the Album Map. Even if there are many markers because of many pics inside the album it would be nice to see roughly how the pics spread over a certain area which would mean the zoom should be automatically chosen depending on the area size - like picasaweb does .. |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
Would it be possible:
|
||||
rWatcher
![]()
Joined: 2005-09-06
Posts: 722 |
![]() |
|||
sddroog wrote:
After clearing the exif_coordinates tabels and rescanning, all my items are being displayed correctly on the map now. Thanks a lot! And the new features are great to! Cool, glad to hear it's working huebi wrote:
I really enjoy this and its what i'm looking for. Tried out G2 with gmaps and it didnt work very well. CaptainRudi wrote:
Thank you so much for your hard work !!! It _should_ automatically select a starting zoom level that displays everything on the current map. Is it not doing that? If it's not auto-zooming properly, what map type are you using, and would it be possible to get a link to an album that's not zooming correctly? Serge D wrote:
Would it be possible: toolbar area --> Where do you mean by toolbar area? Where the slideshow icon is, or somewhere else like the options menu that shows up on the thumbnails or the album options drop-down menu at the top of the screen? |
||||
CaptainRudi
Joined: 2006-07-06
Posts: 16 |
![]() |
|||
Hi, sorry for being unspecific ... I was talking about this one here: MtnBiker wrote:
Something to think about if you love coding: At the album level show the map with pins for all the photos in the album. One difficulty could be nested albums. rWatcher wrote:
I thought about doing this originally, but when an album has a lot of photos in it, it just becomes too many red markers on too small of a map. You can manually specify a single location to display via the Edit album dialog though. I would think it would be great whatsoever if we could have the map at the album level in the sidebar like picasaweb does ... The zoom itself after clicking on the "Map this album" works absolutely smooth ! |
||||
Serge D
![]()
Joined: 2009-06-11
Posts: 2466 |
![]() |
|||
@rWatcher: Quote:
toolbar area icon area just above sidebar next to slideshow. Do not like drop-down menu area, because I consider it an admin option Quote:
I can change it to match the actual map labels, that's not a problem It would be great, then it would be more transparent of what to use. |
||||