I created a couple of patches for ZenPhoto to add some much requested functionality.
First of all, I created a patch that adds EXIF reading capabilities to ZenPhoto itself. It adds some simple functions that theme authors can use print formatted EXIF information. The rest is handled completely transparently. One important difference between other solutions for EXIF reading is that the data is filtered beforehand. This ensures that the output of the functions are actually useful to be displayed, and not the raw data that is stored in the JPEG file.
One of the area I payed some extra attention to is the support of Geotagging. If present, the EXIF patch reads the Geotagging information in JPEG files and transforms it to a format that is used by the various map APIs such as Yahoo Maps and Google Maps and Google Earth. An example of what can be done with the Geotagging information can be found on my own gallery. Just click on the ‘Toon locatie’ button in the bottom left of the page:
http://nielsenwilma.nl/italy/DSC02083.JPGI also added RSS and Atom output. The RSS output should be compatible with iTunes (not tested yet) and includes MediaRSS information which is compatible with Flickr. Reading the RSS output in FeedDemon for example shows thumbnails, descriptions and dates for every photo. The RSS output also includes the Geotagging information (if applicable) using the ICBM extension. Examples:
http://nielsenwilma.nl/trier.rsshttp://nielsenwilma.nl/scotland.atomFinally I also added KML export for use in Google Earth. For every geotagged picture it places a small thumbnail on the map, and if you click on the thumbnail it will open a larger version of the picture and the description and a link back to the ZenPhoto gallery. Example:
http://nielsenwilma.nl/scotland.kmlI’ve added the patches to the bugtracker, so perhaps these functions will be included in a future version of ZenPhoto.
Comments
I'm not sure. I haven't seen those in quite a while. I fiddled with them when they were released, but the problem is they require modifications to zenphoto core code in versions earlier than zenphoto v1.0.3, and I don't think they'll work right in the newer zenphoto versions. So even if you were to get the code for them, they may not work at all since zenphoto's core code has changed.
Tristan might have saved those somewhere before the old confluence pages went away, but I'm not sure.
There is no reason why the zenphoto EXIF implementation that is being worked on now can't be extended at some point to include geotagging, but the EXIF library would have to be set up to support it.
For now, you can use the latest SVN code (rev 438) to include EXIF viewing capability, and I hope to work with Tristan (the developer) to get more theme functions written for EXIF stuff shortly.
You can see an example here:
http://www.bushwoodworking.com/zenphoto/projects/bushwoodtools/markingknives/IMG_2901.JPG.php#
(click on the EXIF Data link below the image)
This uses the new Zenphoto EXIF implementation to display the EXIF tags in my images.
For the RSS piece, I have RSS working here:
http://www.bushwoodworking.com/zenphoto/index.php?p=latest
This is not using official zenphoto code yet though, this is a hack I built from things I found around the forums here. I'd be glad to share if you want.
Thanks for the information. I would be interested in seeing the code you wrote/collected for displaying the EXIF data -- that is, if you don't mind sharing it.
I really am interested in the geo-spatial data, displaying of maps w/photos, and Google Earth kml downloads. I figured that the code wouldn't be entirely compatible with the newest ZenPhoto but I'm not afraid of coding. Heck, for awhile there I was even writing my own photo album software all because I wanted support for 'tags'. I came up with the following demo of real working code after working on it for about 2 weeks (evenings, after work):
http://www.thenullpointer.net/wordpress/wp-content/uploads/2006/12/tnppg-project-video.mov
Seeing Rakaz's demo has me excited about ZP once more -- I'd really love to give it a try.
Which code would you like from me? Since I'm heavy into the new EXIF functionality work, I'm not using the older hacky EXIF stuff. If you would like a copy of the old stuff, I can send it to you (although it doesn't do anything more than the the newer integrated EXIF we're working on)
I can't believe I missed it when it came up before... it's really good stuff! The future of online galleries IMHO... when all cameras will have little GPS recievers in them, every gallery could be like this!
Do you have any backup copies of it from the old confluence web stuff?
Oh, maybe I mis-understood what you were saying. I should just checkout the SVN repo to get the cool EXIF stuff.
@trisweb
I'm *really* happy to see that you're interested in integrating the visualization of the geo-spatial data into ZP. I would be more than happy to help out in the effort. I'll be checking out the SVN this weekend to see how the EXIF stuff is coming along.
Re: Cameras with GPS
One neat thing is there is software available for almost every platform that allows you to select a photo/photos and geocode them manually using Google/Yahoo Maps. While I use a GPS for my newest photos, being able to go back to older photos and say, "This group of photos was taken ::click:: there" is *very* neat.
If you want, you can check out the library that is being used to do the EXIF stuff. It might be able to be extended to include the Geotags. It's located under the /zen/exif folder I believe.
What camera manufacturers and models support that sort of tagging now?
IIRC there is only 1 camera that actually has a GPS in it. For everyone else (like myself) the photos are geocoded with programs (either Automated or point-n-click on a map).
The EXIF specification has fields for GPS Information -- here is an example from one of my geocoded photos:
- GPSVersionID: 2,2,0,0
- GPSLatitudeRef: N
- GPSLatitude: 47 4810.3752
- GPSLongitudeRef: W
- GPSLongitude: 122 2922.92
- GPSAltitudeRef: Sea level
- GPSAltitude: 75/1 meters
- GPSMapDatum: WGS-84
I'll be checking the library out in a couple hours. I'm hoping it can do the deed.I quickly found where ZP defines what EXIF data is being pulled, and added Lat/Long+Refs, Alt+Ref to the list.
I then found the theme function that dumps the data and edited the testing template to dump the data.
Hmmm...the EXIF library as is does formatting for *some* of the GPS fields, but not all of them. So I found myself thinking: What does Altitude Reference: 0 (or 1 -- only two possible values) mean? What does Altitude: 75 mean? Once I figured out what it stood for I added some extra formatting (following the same style the other formatting code uses) and now have 'Altitude Reference: Above|Below Sea Level' and 'Altitude: 75m'
I'm very happy that the EXIF library used has the ability read GPS Data. As an example I placed a few of my recently geocoded photos online-- my SVN ZenPhoto album:
http://mu.thenullpointer.net/Silverdale_Brewery_and_Geocaching_200704/IMG_0014.JPG.php
Submit this to Tristan for his review. This would be perfect to add to the development code for EXIF.
Cool. Zenphoto is just getting better all the time.
I'm not sure the proper channels to contact Tristan w/svn diffs.
If you know or Trisweb responds, I'd be happy to send them along.
Your code for the displaying of the EXIF data in a nicer way... might I sneak a peak? I'd be glad to give you my diff file for the geocoding if you were interested.
(This is a sneaky way of bumping the thread -- I don't want it to get lost in the depths of time again)
I have searched your website for a way to email without luck.
Perhaps we could continue our discussion outside of the forum. My email is: mannkind@gmail.com
http://blog.feedmarker.com/2006/02/12/how-to-make-better-modal-windows-with-lightbox/
Second, keep an eye out in your inbox for my zip archive of the relevant files.
Sorry it took me so long.
If you want to submit diffs the best way is to open up a new enhancement issue on Trac and attach them. I like to keep everything there, and I'll be notified when you do it and will be sure to integrate your changes.
I love that Google map on the image page. Very cool.
this stuff is great, exactly what I'm looking to implement in a current project.
any progress getting your diffs accepted?
thanks!
EXIF is a great addition to zenphoto. However, Tris is currently the only one with commit access to SVN. We are working on the possibility of additional SVN commit privileges from him, but he is very busy with his new endeavor.
Where it stand right now, I have completed the ability for zenphoto to display EXIF tags from within the EXIF library built into zenphoto. Tris was starting the method by which the tags could then be written to the database for each image, thereby "caching" the information for each image in the DB instead of calling it from the image each time. However, since he has been quite busy, development on this has stalled. Without these methods, EXIF still works, but isn't fully integrated into the DB. I have a working concept on my site (http://www.bushwoodworking.com/zenphoto) using the latest SVN code, but haven't gone any further than that.
And that's where we're at today. I'd be happy to share everything I have to this point.
I just found the mannkind's ticket with a diff to add google map location support with gps exif, which I'll definitely be making use of. I'm very new to subversion, though, so I'm not quite sure how to merge this in with my installed trunk.
I don't need to use the lightbox style display, but if your implementation offers other benefits to the current trunk, I'd be very interested in learning how to incorporate it.
thanks!
I'm trying to use your patch from ticket #78, but I'm not sure how to run the patch command.
I'm running SVN r441, and put trunk.zen.diff in the root folder, then ran: patch -p1 < trunk.zen.diff, but get this:
`[~/zenphoto/trunk]# patch -p1 < trunk.zen.diff
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: themes/testing/album.php
|===================================================================
|--- themes/testing/album.php (revision 441)
|+++ themes/testing/album.php (working copy)
--------------------------
File to patch:`
I know I'm doing something wrong, just don't know what!
The SVN is complete enough to display EXIF tags just fine (the lightbox functions are theme based and just something I came up with to display the EXIF tags in a non-intrusive manner). The function `<?php printImageEXIFdata(); ?>` is what you'll want to refer to to obtain the tags in your theme. You can find it in the template-functions.php file for more detail.
Looking at the 441 SVN revision however, it looks like the `printImageMetadata` function replaces the `printImageEXIFdata`. I am not on the latest revision, so I may have to remedy that at some point so we're all comparing apples to apples.
Shouldn't change much though on the display side of things. Let me know how I can help further.
If you know where I'm going wrong trying to apply that patch, I'd appreciate any insight.
Hmmm.