Does anyone know some opensource Java library for reading and writing IPTC metadata to JPEG and TIFF? Now I'm using Apache Sanselan. Unfortunately, it can only read IPTC, not write (http://commons.apache.org/sanselan/formatsupport.html).
Will be very grateful for your assistance.
Denis.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I've looked myself in the past but not found one. I would suggest looking at an open source project such as http://sourceforge.net/projects/image-tagger/ and see how they do it.
This seems to be quite a old question but following is some helpful info:
reading of metadata such as EXIF,IPTC..etc can be done using Apache Commons Imaging(Formerly Sanselan) or Metadata Extractor(by drew noaks).
writing of metadata can be done using Apache Commons Imaging using following classes:
EXIF - ExifRewriter (http://commons.apache.org/proper/commons-imaging/apidocs/org/apache/commons/imaging/formats/jpeg/exif/ExifRewriter.html)
IPTC - JpegIptcRewriter (http://commons.apache.org/proper/commons-imaging/apidocs/org/apache/commons/imaging/formats/jpeg/iptc/JpegIptcRewriter.html)
XMP - JpegXmpRewriter (http://commons.apache.org/proper/commons-imaging/apidocs/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpRewriter.html)
Take a look at IIM4J. Use
IIMWriter
to write IPTC IIM tags into (jpeg) images.For reading metadata I think you should have a look on "metadata-extractor" - an Open Source Project (Apache 2.0 licence) that develops a Java library for reading metadata from image files.
At the moment, this project can get access to the following metadata of images:
The "metadata-extractor" is hosted at google code.
Here is a little straightforward code-example for the 2.4.0 version:
The Apache Commons Imaging (formerly sanselan) has added support for writing IPTC metadata in the svn repo code for their next release. I have verified that this is so in the latest trunk code checked out from svn repo. The code seems stable so I am hoping a release is not too far away. For my project this is good enough.