Reading photos data (Exif) from LotusScript

I was writing a Notes application to catalog photos saved on a network directory.

That was a good opportunity reading data within photos saved by modern digital cameras.
What kind of data? For example photo date/time, camera maker, etc.

That data format used by digital camera is called Exif, that is Exchangeable image file format, read by many imaging software.

I found a free Java library, Metadata Extractor. Take a look, it is very useful.

That was a good opportunity for me to write a Java library inside Lotus Notes and also take advantage of the LS2J (LotusScript to Java) interface to call Java code from a LotusScript agent.

First I wrote a very simple Lotus Notes Java library, ExifReaderLib, to wrap some calls to the MetadataExtractor library; then I wrote a sample LotusScript agent, "test ExifReaderLib", to show how to use exifReadLib using LS2J technique.

Class "ExifReader"

parameter= photo full-path filename to analyze

method getTagValue("mytagname")
parameter= tag name (e.g. "Model")
Return a string description for a given tag name

method getAllTags("$$$")
parameter= string separator t (e.g. "$$$" )
Returns a string with all tags and descriptions found inside the photo, separated by a string (the separator parameter)

I tested the code inside Lotus Notes R8, but it should work in R7 too.
Use at your own risk ;-)

download EXIFLS2J.zip , my test Lotus Notes db (hosted on divshare.com)


Anonymous said...

Wow! This looks great! Can't wait to check this out.

Quick question, is it possible to use this on an embedded file without first detaching it?


Unknown said...

I guess you need to detach it, the library needs a filename to analyze.

Anyhow, it's not difficult to develop a LS agent that temporarily detach a photo (from a Notes Document) into the TEMP dir, then analyze the file as my agent does, then delete it from the disk...

Have fun!

Anonymous said...

Yes, this is a great library. we use it in the BlogSphere template for the Photo Album functions.

One important thing to note is that EXIF data does not exist for all image types so always best to restrict the type of selectable files.

Unknown said...

Hi Declan,

I just downloaded the BlogSphere template and I've just realized that it's full of nice agents and libraries!

Since I use the a Blogger blog template, I never cared to take a look to your nice work and all the people involved in the project.