Updating metadata using Java and iCAFE

Viewed 55

This answer explains how to update metadata. How to manipulate image metadata in ICAFE

I wanted to update both the EXIF and the IPTC sections, retaining existing metadata values. The Metadata.insertExif allows updating EXIF using the update parameter but cannot be used with the Metadata.insertMetadata(metaList, fin,fout) where I have created a List in order to update multiple sections within the metadata (EXIF and IPTC) e.g. List metaList = new ArrayList<>(); I assume I can do it using two passes - once to update EXIF and once to update IPTC. Is there a way to do this in one pass i.e. retrieve existing EXIF and then update EXIF and IPTC?

1 Answers

This library is not a photo editing software in itself so it is hard to find a point where the user can achieve most of the goals they want and in the mean while don't get it two complicated in the implementation. This is how it looks for now.

That said, it is not possible to insert with update more than one metadata at the same time. You can definitely do this in two passes as you mentioned in your question. You can also do it a different way which makes manipulating existing metadata more flexible.

To do that, you can use Metadata.removeMetadata () to remove both Exif and IPTC. This method will keep the removed metadata as return value so you can later do whatever you want to them and then use Metadata.insertMetadata () to insert the new Exif and IPTC back to the intermediate file which has the two metadata removed (if any) in one shot.

Related