Fix for issue 2504 - IPTC and ICC profile information being lost during TIFF file save #2535
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
When testing adding and writing out IPTC tag data, it was found that the data was being lost during the save process for TIFF files. It was also determined that the ICC profile data was also being lost.
During debugging, it was found that the Exif and XMP profiles were coming from the root frame only, and the IPTC and ICC profiles were coming from the image and not the root frame.
The changes introduced by this pull request split the writing of the image's metadata from each frame's metadata. Also, rather than only using the profile data from the root frame, the metadata for each frame is written instead. If multiple frames in the TIFF file have different metadata settings, that should preserve the data for each frame.
A new unit test was added to store and retrieve IPTC and ICC profile data, to verify that they were being saved and loaded correctly.