Hi Chris,
On Mon, 4 Mar 2013, Chris Pudney wrote:
> What is the recommended way for a plug-in filter to read an image's EXIF
> data?
>
> I could repeat what is done in the EXIF Reader plug-in
> (
http://rsbweb.nih.gov/ij/plugins/exif-reader.html) but before I
> reinvent the wheel I wanted to check whether there's a different/better
> approach.
There is a valid alternative to reinventing the wheel: reusing it.
In this particular case, you could simply copy the Exif_Reader.jar into
the plugins/ directory and then use the methods of
http://drewnoakes.com/code/exif/ in your own code.
Note, however, that it is infinitely superior to ship the
metadata-extractor .jar file separately, as downloaded from:
http://code.google.com/p/metadata-extractor/downloads/detail?name=metadata-extractor-2.6.4.zip&can=2&q=Why? Because metadata-extractor has been updated several times since the
Exif_Reader.jar was updated last time. In general, it is an awful practice
to include classes from another .jar in one big .jar because it interferes
with -- and breaks! -- other plugins depending on the same classes [*1*].
The worst thing about it: the developer will not have the problem, but the
users.
Ciao,
Johannes
Footnote *2*: you can learn from the Massive Stitcher which was shipped
including all of Stephan Preibisch's Stitching. When Stephan updated is
plugin, users got all kinds of nasty exceptions and the only simple way to
fix it was to remove the Massive Stitcher -- not good!
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html