Re: EXIF tag handling in Java
Martin Gregorie wrote:
Lew wrote:
Martin Gregorie wrote:
Lew wrote:
Martin Gregorie wrote:
If the PHP menu generator is unacceptably slow when dealing with
EXIF tags, I'll use the aesthetically ugly trick of keeping the
captions as a separate CSV list (filename,caption) which will
probably be faster since at the start of the run it can be loaded
into a Hashtable (Java)
or associative array (PHP) once and will stay in memory while the
menu builder is running.
I recommend against use of 'java.util.Hashtable' in favor of the
modern (since 1998) 'Map' implementations.
Noted. I only considered Hashtable because they are favoured by some of
the javax.imageio.* packages - scarecely surprising since most of these
packages seem to have been around since at least Java 1.4.
Very, very surprising since the modern collections classes were
introduced in Java 1.2 and the javax.imageio package in Java 1.4.
You should check the Javadocs.
I did: for some operations you need to use a filter which is based
java.awt.image.ImageFilter. This gets passed properties via the
setProperties(Hashtable<?,?>) method.
You are awesome. Seriously.
That is a deep dependency and I sure am grateful to you for digging that on=
e out. 'java.awt.image' is legacy 1.0 code.
I wonder if the Powers That Be would consider adding a 'Map<?, ?>' overload=
to that call. Probably not worth the effort.
On a related note, 'java.util.Properties' extends 'Hashtable<Object,Object>=
', but if you use that upcast you lose default properties. (That 'Propertie=
s' is defined in terms of 'Object' but can only use 'String' is one of its =
interesting aspects.) (They did add 'public Set<String> stringPropertyNames=
()' in Java 6.)
On a tangential note, all this is exemplary of why Java programmers tend no=
t to be acolytes of the language.
--
Lew