Gallery2 plugin – displaying googlemaps with GPS coordinates from EXIF
After resuming my geotaggin script (see this post), I decided to do something useful with it. We’re using gallery2 to store our photos and with a googlemap plugin, but found it useful only for displaying a single pointer per album (see here). For a more fine-grained selection we needed something else.
Therefore, I decided to write my own plugin (yeah, there are already two out there, why not write my own?
) and also learn Gallery2 API. The idea is to display a google map at the bottom of each photo, showing exactly where the photo was taken. Yes, it photo-specific and there’s only one pointer on the map. I find it nonetheless very useful.
Here’s a sample output (you can also admire the beautiful scenery of Melchsee
). The plugin adds a new “block” in the template (therefore can be configured using a standard block management tool in Gallery2).
The position of the current photo is always in the middle (although you can move the map around, change the map type, zoom in and out etc.). The changes you make are stored as session cookies, and preserved between consecutive photo loads. Also, the whole panel can be hidden to speed up load and only shown on demand (show map|hide map).
Any comments? suggestions? ideas?
The plugin is currently in alpha stage, I will release it in a week or two (I want to create a webpage for it as well). In the meantime, if you’re interested in trying it out, drop me a line
BTW: I also found out that when iPhoto edits a photo, it converts Exif from Intel to Motorola (little endian -> big endian). There was a bug in exifer used in gallery, which corrpted the tags. The patch is only two lines long and can be found here (I also emailed the author):
--- gps.inc.orig 2006-08-31 10:25:27.000000000 +0200
+++ gps.inc 2006-08-31 10:36:37.000000000 +0200
@@ -116,13 +116,24 @@
$minutes = GPSRational(substr($data,16,16),$intel);
$hour = GPSRational(substr($data,32,16),$intel);
- /* now we need a hack, since the whole data has been flipped in :103
-
- the order here is sec:min:hour. However, in the motorla mode the data
-
- has not been flipped and the order is h:m:s. This breaks compatibility
-
- with Motorola exif. (Tadek) */
- if($intel==1) $data = $hour+$minutes/60+$seconds/3600;
- else
$data = $seconds+$minutes/60+$hour/3600; } else if($tag=="0007") { //Time $seconds = GPSRational(substr($data,0,16),$intel); $minutes = GPSRational(substr($data,16,16),$intel); $hour = GPSRational(substr($data,32,16),$intel);/* I guess the same HACK as above. Tadek */- if ($intel==1) $data = $hour.":".$minutes.":".$seconds;
- else
- $data = $seconds.":".$minutes.":".$hour; } else { if($bottom!=0) $data=$top/$bottom; else if($top==0) $data = 0;
September 10th, 2006 at 8:08 pm
[...] Tadek’s Blog Some random notes about computers, security, cool links and others. « Goodbye IBM, welcome Google Gallery2 plugin – displaying googlemaps with GPS coordinates from EXIF » [...]
September 16th, 2006 at 4:15 am
do it, release it!
sounds interesting and i just got my gps receiver today…
looking forward to it, muesli
September 27th, 2006 at 10:54 pm
This looks fantastic – I look forward to the release – would be great to use it to display my holiday snaps next month
October 1st, 2006 at 7:27 pm
[...] Finally, all of these photos can tie into Gallery (which is what I’ll be doing) using the existing Google Maps Module, or watch this space on Tadek’s blog, for a module to view locations on single images. [...]
June 1st, 2007 at 9:35 pm
Nicest would be to open an album and have a map with placemarkers for all photos then click a placemarker and see the photo in the same screen am experimenting with the maps module but this is not at all using the allready avaulable geotag info from exif in my jpeg files
I am looking forward to you publishing this!
February 4th, 2009 at 8:32 pm
It sounds great !!! Well, i’d like to try it. And compliments for your pictures. I live near Switzerland but….i’ve never been in such wonderful places ;(
July 2nd, 2009 at 3:24 am
did you ever release this? also, the theme listed on your gallery appears to point to the blog postings of your photo partner in crime, and the links appear…empty!