Wish List
Tags
adobe air ajax cf community cfml coldfusion examples ext flex javascript max2007 misc programming technology ui
Recent Entries
One Bourbon, One Scotch and One Beer
Getting Closures: The Groovy Way
Adobe Photoshop Elements 7 Announced
Getting Started with Flex 3
Adobe Munich Sponsors Girl Geek Dinner
Currently Reading
Search
RSS
Subscribe
Blogroll
An Architect's View
Ben Forta
CFSilence
Coldfusion Jedi
Rey Bango
TalkingTree
CFIMAGE Part 2
In my previous post CFIMAGE Part 1 we created a simple image and added some text to the image and wrote it out directly to the browser.
In this post we will look at the EXIF data of an image. Typically the EXIF or Exchangeable Image File Format gets written to an image mostly during the creation process of modern digital cameras and only with JPEG images. Some additional information may get written to the image during post processing in Photoshop or other imaging software.
When you upload an image to a service such a Flickr the EXIF data gets stored along and is made available to viewers of your image.
With the inclusion of this tag we now have access to the data ourselves and can likewise use the info in our own photo album applications for example.
It's relatively simple to use, you need to first read in your image using either the cfimage tag or the ImageNew function and then call the ImageGetExitMetadata function.
I'm using one of my favorite photos from our trip to the Tuscany region of Italy in 2006.
<cfset exifData = ImageGetExifMetaData(MyImage)/>
<cfdump var="#exifData#"/>
Produces a dump similar to the following:
| The Image | The EXIF Data |
|---|---|
|
|
Thats a lot of information packed into the JPEG file!
What I find great about the information, being an amateur photographer, is that you have easy access to things such as F-stop, ISO speed, Focal length, and the exact time you took the image. Most of the time I forget what the F-stop or exact Focal length at which I took the image. A sign of a real amateur no doubt!
You can also get just a single EXIF tag's information using the ImageGetExifTag function for example.
<cfset EXIFFocal= ImageGetExifTag(MyImage,"Focal Length")/>
<cfoutput>#EXIFFocal#</cfoutput>
Would result in 85,0 mm being written out to the browser.
Happy Coding....



Nikon and Canon dSLRs typically have RAW and JPG capture formats, and EXIF is written to each format. If you use something such as Adobe Lightroom or Bridge CS3 (it comes with Photoshop CS3) then during the initial import of photos from your Compact Flash card to your computer you can automatically apply a preset template of your preferred IPTC data, this way all images could immediately be given basic IPTC data such as Author, Author email/website, and Copyright Notice.
Yes I am using a European locale, as I am based in Munich Germany (I will have to switch my home computer back to US thank for point that out :) ).
Thanks for the tip on applying IPTC. Unfortunately I can't afford a copy of CS3 or Lightroom (my trial version ran out ) So I am stuck to doing it the old way
I just installed CF8 and ImageGetExifMetaData works fine.
Where can I get the complete list of the names behind the struct?
Example:
<cfimage source="IMG_0724.JPG" name="MyImage"/>
<cfset exifData = ImageGetExifMetaData(MyImage)/>
<cfoutput>
Model: #exifData.model#<br />
Orientation: #exifData.Orientation#<br />
Date/Time Orginal: #exifData.?!?!#
Exif Image Height: #exifData.?!?!#
etc.
</cfoutput>