dragon66 / icafe

Java library for reading, writing, converting and manipulating images and metadata
Eclipse Public License 1.0
204 stars 58 forks source link

Add support for inserting more than one metadata types to the image without creating temporary file #43

Closed dragon66 closed 7 years ago

dragon66 commented 7 years ago

There have been questions and requirements regarding inserting more than one metadata types into the image in one operation (method call) to avoid creating intermediate temporay files. This is the attempt to accomplish that purpose. Initially, we are not going to support update to the metadata. The old metadata of the same type as the inserted one will be replaced by the new one.

dragon66 commented 7 years ago

For JPEG image, if APP1 EXIF segment exists in the original image and we want to insert new EXIF, the old EXIF data will be removed and the new one is inserted in place of the old one. All the other metadata will be inserted after EXIF.

If there is no EXIF in the original image and we need to insert EXif, we will first try to see if there is an APP0 JFIF segment. If it exists, we insert EXIF along with other metadata after APP0 JFIF.

dragon66 commented 7 years ago

Checked in insertMetadata(). Works for JPEG image to insert EXIF, XMP, IPTC, ICC Profile, and IRB in one step.

dragon66 commented 7 years ago

Added insertMetadata() to TIFFTweaker. Now both JPEG and TIFF are supported. Closing this issue.