April 2, 2008

When I reviewed the photo gallery theme on monday I pointed to my photoblog where I was using it as an example. In some of my posts I was displaying the photo’s EXIF data and today someone asked me how I did that. The answer to that question is that I wrote a script a while back to do it for me; however, WordPress 2.5 has new capabilities and one of these is extracting IPTC and EXIF data from photographs when they are uploaded. So I set about finding out how to access it.

So far I haven’t been able to find any specific functions for displaying the data that is generated. I guess this is what Matt meant when he tagged it as a bonus feature. If anyone has any ideas about displaying it using template tags then let me know, but for the time being I have written a small plugin to display that data.

Here is a sample below:


[photodata]

The plugin

Once downloaded and installed you need to include the following code in your post:

[photo-data:#]

Replace # with the ID of the attachement. This is easy to find by looking at the code that WordPress adds to your post. WordPress includes a class of wp-image-229, where 229 is the ID.

I have written this fairly quickly so it has been tested on one WordPress 2.5 blog: this one. I am happy to hear any suggestions about ways to improve it.

This has now been updated to take advantage of the shorttags in WordPress 2.5. It is also even easier to use because a URL can be passed instead of an ID. Please visit the link below for the read me file.

You can Download it here fun-with-photo-data



Wordpress feature image page?
24 comments on page 1065

Addsettingsfield?
3 comments on page 793

Shorter link?
4 comments on page 1190

Shorter link?
4 comments on page 1190

Cssimageforlogin?
no comment on page 128

Cssimageforlogin?
no comment on page 128

Get featured image url wordpress?
24 comments on page 1065

How to clear wpcache?
9 comments on page 1310

Photo gallry code html5?
6 comments on page 1305

Wordpress get image size?
24 comments on page 1065

Sitecouk wptheme?
2 comments on page 1376

Wordpress chat disqus?
no comment on page 1308

Howtocreategoodsizelayout?
4 comments on page 1026

Friend connect profile?
6 comments on page 1364

Get medium image from post?
24 comments on page 1065

Tabbed widgets wp?
no comment on page 333

Wordpress pictue cache lschen?
9 comments on page 1310

Wordpress plugin post separator?
no comment on page 1371

Display photos html 5?
6 comments on page 1305

Fun wordpress themes?
2 comments on page 1376

Wp featured image without size?
24 comments on page 1065

Wordpress get url global?
4 comments on page 1190

Wp unlimited?
3 comments on page 1141

Html5 image gallery?
6 comments on page 1305

Wordpress exif plugin?
12 comments on page 230

Css login screen?
no comment on page 128

Htlm 5 photo gallery?
6 comments on page 1305

Css login screen?
no comment on page 128

Comments by intensedebate?
7 comments on page 1175

Image gallery html 5?
6 comments on page 1305

Wordpress andrew rickmann?
2 comments on page 1376

Wordpress medium large?
24 comments on page 1065

Fun with uninstallation wordpress?
53 comments on page 100

How to clear wp cache?
9 comments on page 1310

Photoshop frameworks?
3 comments on page 296

Html5 gallery?
6 comments on page 1305

Html 5 photo gallery?
6 comments on page 1305

Login screen css template?
no comment on page 128

Html5 photo gallery code?
6 comments on page 1305

Wordpress post multiple images?
24 comments on page 1065
  every 1992s, 1s ago, in 0.03s.
 __
(__)
   `
 travesti

thank you good

 __
(__)
   `
 Andrew Rickmann

David, I have update the plugin. You can now choose what message is displayed. If you wipe it so it is blank then nothing will be displayed, not even the title. The plugin page is here: http://www.wp-fun.co.uk/fun-with-photo-data/

 __
(__)
   `
 david smeaton

hey andrew, this is a great plugin!!! i love it because it's so simple … i'm the first to rate your plugin here, i gave it 5!! :)

i have a suggestion for future versions (i'm hoping you're going to continue updating this plugin). when the photo has no exif, it says 'no data available for this image', it would be great to have a check box on the options page to not show this comment. all of my digital photos have exif, but my film scans have no exif data. instead of showing a 'no data' comment, i'd rather it said nothing at all.

of course, i can comment that part out of the script (or change the comment to read nothing), but for simplicity it would be great to have a checkbox that gave the same option.

anyway, love your plugin … simple and useful.

thanks for your hard work.

cheers

david
http://www.davidsmeaton.com

 __
(__)
   `
 teknoloji

I need it for my photo blog. :)

 __
(__)
   `
 Sa

Good plugin Andrew.Thanks.
I need it for my photo blog.

 __
(__)
   `
 Shutter Themes | WP-Premiums

[...] image resizing plugins and scripts out there (such as Viva Thumbs, TimThumb, or Get the Image), and Andrew of Fun with WordPress has created a plugin to facilitate the inclusion of EXIF [...]

 __
(__)
   `
 Joshua

Andrew,
Fantastic plugin! I couldn’t figure out how in the world to have WordPress just do this itself, but this one works perfectly. What about the possibility of having it automatically insert the shortcode into any post that contains just one image, for example? (Just to save me some time! ;-)) Thanks again for the work!

 __
(__)
   `
 Chris Osborne

What fun. The people over at Flickr think that if someone wants to see the EXIF, they should go over there and see it. And I’d rather let people see it right from my blog.

 __
(__)
   `
 Andrew Rickmann

Chris,

I don’t know how Flickr handles these kinds of things but as it resizes images it may or may not remove the information from the image, so perhaps it is possible to extract the information from the image, or perhaps you would need to interface with the Flickr API and see if it is possible to pull the information out that way.

Either way it is a completely different thing to what this plugin does so this plugin would be of no use as a starting point.

As this does is pull information from the WordPress database and put it on screen. The WordPress core does the real work.

 __
(__)
   `
 Chris Osborne

I figured that was the case when I read, but I thought I’d ask anyway.

After looking around everywhere it seems that’s what all the plugins do. Just based purely on theoretical stuff, would it be easier for someone to work from this to get what I want or would it be better for me to start from scratch?

 __
(__)
   `
 Andrew Rickmann

Chris,

This pulls data from the WordPress database. It doesn’t read any information from the images themselves and so won’t work with images from anywhere else.

 __
(__)
   `
 Chris Osborne

Is there a way to make this work with images hosted at Flickr?


0.01s