Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for issue 2504 - IPTC and ICC profile information being lost during TIFF file save #2535

Merged
merged 2 commits into from
Sep 15, 2023

Conversation

JeffP134
Copy link
Contributor

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

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.

@CLAassistant
Copy link

CLAassistant commented Sep 13, 2023

CLA assistant check
All committers have signed the CLA.

@JeffP134
Copy link
Contributor Author

Stylecop extra line issue should now be fixed.

The code duplication was bugging me, so I refactored the code to extract out common methods as well.

Copy link
Member

@JimBobSquarePants JimBobSquarePants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks fantastic! Thanks so much for your help here. 👍

@JimBobSquarePants JimBobSquarePants merged commit da4d4d7 into SixLabors:main Sep 15, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants