I've got a Zenphoto site up and running using Steve Moody's StopK2 theme to integrate with my Wordpress blog. I wanted to show EXIF data with my pictures, and hacked up the image.php in the theme to do that using exifer1_5, a PHP package for decoding EXIF data (for those of us on hosted systems where PHP native EXIF support can't be compiled in). I really wanted to be able to show under the image something like "Shot by Eric DeSilva on October 12, 2006 with a Nikon D200 and a 18-200mm f/3.5-5.6 AF-S VR lens (24mm actual) on Manual. Exposure at f/3.5 for 1/250th of a second."
Using my hacked up version of StopK2, I could do all of that, except for the lens part. Even though I could see "lens used" data in my Adobe apps looking at the jpg files, I couldn't find that data in the EXIF associated with the file...
Then I discovered the problem... That particular data element is associated with a "makernote" in EXIF--basically an extension that is manufacturer-specific. Adobe applications like photoshop (Adobe is not the only offender here--most image manipulation programs do this) read the makernotes, but don't write them... Adobe actually does store the data in the jpg (as long as you don't "save for web"), but its in XMP format--something of their very own that they are trying to standardize. (Yeah, I could use a file that hasn't been run through Adobe, but I tend to shoot 6MP or 10MP NEF (Nikon RAW) images--kind of web-unfriendly.)
Eventually, I found a PHP toolkit that will decode EXIF *and* XMP metadata. Its ozhiker's PHP Metadata Toolkit:
http://www.ozhiker.com/electronics/pjmt/library/documentation/example.html
It is a *lot* of PHP code, however. I've started sorting through it, and its not particularly easy to extract the specific data I want. But, I may still try. Which brings me to my real question...
My intuition tells me that if I'm forcing the server to run a whole bunch of PHP every time an image is displayed, that is really going to slow down the interface. The other option is to do something like write a standalone PHP tool that goes through the data table, does a one-time extraction of the XMP data I want, and then writes the data into a new column in the table which is then displayed by zenphoto. Before I embark on this, since I'm a pretty new PHP programmer, anyone care to comment? It kind of offends me to write data into a table that is already there (albeit embedded in a jpg). But, is my sense that rerunning the XMP parsing over and over again a bad idea? Any thoughts on how to get this done? I was thinking a new button on the admin page--"get metadata" or something--that would invoke a procedure to go through the table, row by row, extract metadata if it isn't present already, and write it to the table.
Any comments, suggestions before I dive in?