888888.888888.88""Yb..dP"Yb..8888b..Yb..dP.88b.88....db....8b....d8.88..dP""b8..dP"Y8
88__...88__...88__dP.dP...Yb..8I..Yb.YbdP..88Yb88...dPYb...88b..d88.88.dP...`".`Ybo."
88""...88""...88"Yb..Yb...dP..8I..dY..8P...88.Y88..dP__Yb..88YbdP88.88.Yb......o.`Y8b
88.....888888.88..Yb..YbodP..8888Y"..dP....88..Y8.dP""""Yb.88.YY.88.88..YboodP.8bodP'


88b.88.888888.888888.Yb........dP.dP"Yb..88""Yb.88..dP
88Yb88.88__.....88....Yb..db..dP.dP...Yb.88__dP.88odP.
88.Y88.88"".....88.....YbdPYbdP..Yb...dP.88"Yb..88"Yb.
88..Y8.888888...88......YP..YP....YbodP..88..Yb.88..Yb

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

Post Image The Easy Peasy Way
Permalink attachment to post wordpress?
26 comments
page 1065
Quick N Dirty Bookmark Navigation
Bookmark navigation?
no comment
page 127
Html 5 Gallery
Html5 photogallery?
6 comments
page 1305
Html 5 Gallery
Image gallery using html5?
6 comments
page 1305
Post Image The Easy Peasy Way
Wp get attachment caption?
26 comments
page 1065
Html 5 Gallery
Html5 image?
6 comments
page 1305
What Wordpress Workflow Needs
Wordpress workflow?
3 comments
page 1226
Html 5 Gallery
Html5 picture gallery?
6 comments
page 1305
Post Image The Easy Peasy Way
Wp codex postimagesmedium?
26 comments
page 1065
Post Image The Easy Peasy Way
Wp postimages order?
26 comments
page 1065
Post Image The Easy Peasy Way
Wp postimages order?
26 comments
page 1065
How To Add Sidebars To A Theme
Register more sidebars?
10 comments
page 1053
Html 5 Gallery
Html 5 image gallery?
6 comments
page 1305
Post Image The Easy Peasy Way
Php post imagesmedium?
26 comments
page 1065
Fun With Sidebar Tabs Styling
Sidebar image interesting?
2 comments
page 336
Post Image The Easy Peasy Way
Postimagesmedium?
26 comments
page 1065
Fun With Sidebar Tabs Styling
Styling tabs css?
2 comments
page 336
Post Image The Easy Peasy Way
Theimage wordpress?
26 comments
page 1065
How To Add Sidebars To A Theme
Add widgetized footer in wordpress theme?
10 comments
page 1053
Html 5 Gallery
Html5 image gallery?
6 comments
page 1305
Wordpress Vs Graffiti
Graffiti yb combined?
8 comments
page 95
Poll Daddy Reviewed
Polldaddy poll?
2 comments
page 42
Html 5 Gallery
Html5 gallery?
6 comments
page 1305
Post Image The Easy Peasy Way
Wp display all post images?
26 comments
page 1065
Why I Ditched Disqus
Add wordpress comments to friendfeed?
5 comments
page 1175
Html 5 Gallery
Html5 gallery?
6 comments
page 1305
Quick N Dirty Post Exclusion
Fitler theloop addfilter?
11 comments
page 124
Using Your Own Url Shortener
Constructor and link shortner?
4 comments
page 1190
My Experience Of Flexx
Flexx of genesis wp theme?
4 comments
page 1026
Html 5 Gallery
Html5?
6 comments
page 1305
Wordpress Chat
Tchat page wordpress?
3 comments
page 1308
Quick N Dirty Post Exclusion
Filter wordpress posts plugin?
11 comments
page 124
Post Image The Easy Peasy Way
Wp post orderby?
26 comments
page 1065
  1 query every 779 seconds, updated 1 seconds ago.
Friday, 7pm
 __
(__)
   `

 travesti

thank you good

Friday, 8pm
 __
(__)
   `

 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/

Sunday, 2am
 __
(__)
   `

 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

Sunday, 2am
 __
(__)
   `

 teknoloji

I need it for my photo blog. :)

Saturday, 10pm
 __
(__)
   `

 Sa

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

Friday, 12pm
 __
(__)
   `

 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 [...]

Tuesday, 10pm
 __
(__)
   `

 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!

Monday, 12pm
 __
(__)
   `

 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.

Monday, 7am
 __
(__)
   `

 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.

Monday, 5am
 __
(__)
   `

 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?

Sunday, 7am
 __
(__)
   `

 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.

Saturday, 8pm
 __
(__)
   `

 Chris Osborne

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