Using EXIF and IPTC Photo Location Information in WordPress

In developing the 2012/13 wordpress theme, I’m currently working on improving the attachment pages for images (images.php). I want to use as much of the meta data that’s stored with the image as possible, especially as I spend a while making sure I’ve titled, tagged and located before exporting any photos from Lightroom.

EXIF data embedded within image files can supply information like aperture and shutter speed for a photograph, and this data is easily accessed using the standard wp_get_attachment_metadata() function available to all WordPress theme writers.

Unfortunately, wp_get_attachment_metadata() doesn’t deal with location information at all. With the advent of Lightroom 4’s Map module, I already have lots of location information contained within my image metadata. Brilliantly, Lightroom 4 “reverse geocodes” the latitude and longitude information, and inserts the country name, province and sub-location into the metadata automatically. I’m wasting all this great information if I don’t use it in my theme!

Next Page: Reading EXIF Data