I must admit that the Java class solution is easier to implement than  
either Imagemagick or adding a Mac with Tiger.

Especially if it is a remote hosted or colo-ed box.

I did notice that the metadata in the example image has at least 1  
instance of incorrect metadata:

[Iptc] Country/Primary Location - Ubited Kingdom

This brings up a good question:

Is it possible to add or edit metadata with the Java classes?

This is important because the metadata of an image (or other file)  
often originates in several places, for example:

1) Image taken with a camera supplying metadata
2) image transferred to, say, Photoshop where image is resized,  
captioned, watermarked, etc. adding or changing metadata
3) Image transferred to some gallery or presentation where additional  
captioning is added/changed, etc. again adding or changing metadata.

If the metadata additions & changes are not made to the image file,  
itself, it defeats the concept of metadata.

Dick

On Feb 19, 2005, at 9:26 PM, James Holmes wrote:

> Java objects:
> http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/java24.htm
>
> The sample code for the class:
>
> http://www.drewnoakes.com/code/exif/sampleUsage.html
>
> I just wrote this from scratch as a pure translation of the sample  
> code and
> I know bugger all about Java:
>
> <cfobject action="create" type="Java" class="java.io.File"  
> name="oFile">
> <cfset jpegFile=oFile.init("C:\iptc_sample.jpg")>
> <cfobject action="create" type="Java"  
> class="com.drew.metadata.Metadata"
> name="oMetadata">
> <cfset MyMetaData = oMetadata.init()>
>
> <cfobject action="create" type="Java"
> class="com.drew.metadata.iptc.IptcReader" name="oIptcReader">
> <cfset oIptcReader.init(jpegFile).extract(MyMetaData)>
> <cfobject action="create" type="Java"
> class="com.drew.metadata.iptc.IptcReader" name="oIptcReader">
>
> <cfset directories = MyMetaData.getDirectoryIterator()>
>
> <cfloop condition="#directories.hasNext()#">
>   <cfset directory = directories.next()>
>   <cfset tags = directory.getTagIterator()>
>   <cfloop condition="#tags.hasNext()#">
>     <cfset tag = tags.next()>
>     <p><cfoutput>#tag.toString()#</cfoutput></p>
>   </cfloop>
> </cfloop>
>
> This is the output for the sample image he provides (I renamed it on my
> system and therefore in the code above):
>
> (http://www.drewnoakes.com/code/exif/exifImages/ 
> FujiFilm%20FinePixS1Pro%20(1
> ).jpg)
>
> [Iptc] Directory Version - 2
> [Iptc] Caption/Abstract - Communications
> [Iptc] Writer/Editor - Ian Britton
> [Iptc] Headline - Communications
> [Iptc] By-line - Ian Britton
> [Iptc] By-line Title - Photographer
> [Iptc] Credit - Ian Britton
> [Iptc] Source - FreeFoto.com
> [Iptc] Object Name - Communications
> [Iptc] Date Created - Thu Jun 20 00:00:00 WST 2002
> [Iptc] City -
> [Iptc] Province/State -
> [Iptc] Country/Primary Location - Ubited Kingdom
> [Iptc] Category - BUS
> [Iptc] Supplemental Category(s) - Communications
> [Iptc] Urgency - 53
> [Iptc] Keywords - Communications
> [Iptc] Copyright Notice - ian Britton - FreeFoto.com
>
> -----Original Message-----
> From: Warren Parsons [mailto:[EMAIL PROTECTED]
> Sent: Sunday, 20 February 2005 11:02
> To: CF-Talk
> Subject: Getting IPTC data into a database
>
> James, thanks a lot for the heads-up. I'd actually ran across the Java  
> class
> you pointed me to earlier today, but since I had no idea how to  
> implement
> it, I let it go.
>
> Right now, I'm trying to find out how I would run the Metadata  
> Extractor
> Library from within ColdFusion (if "run" is the right term). I don't  
> mind
> digging for the info, it is after all me who will benefit from getting  
> this
> working. But if you wouldn't mind posting a bit of sample CF code for
> running it, I would be very grateful.
>
> Regards,
> Warren L. Parsons
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:195651
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to