test(export): cover ICC tagging on RGB TIFF exports - #910
Merged
marcinz606 merged 1 commit intoAug 19, 2026
Conversation
`_encode_export` branches on greyscale before writing a TIFF, and only the greyscale branch was covered. The RGB branch, which is what every colour-space export actually uses, had nothing pinning its ICC tag. That is the path marcinz606#598 reported: a P3 D65 TIFF arriving with no profile while the PNG of the same edit carried one, so the file read as sRGB downstream. Parametrised over every non-greyscale entry in `EXPORT_COLOR_SPACES`, asserting the TIFF carries a profile and that its description matches the PNG of the same buffer. Dropping `iccprofile=` from the TIFF write fails six of the new cases, so the assertion has teeth rather than only passing today.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
_encode_exportbranches on greyscale before writing a TIFF, and only the greyscale branch was covered here. The RGB branch, which every colour-space export actually takes, had nothing pinning its ICC tag.That is the path #598 reports: a P3 D65 TIFF arriving with no profile while the PNG of the same edit carried one, so the file read as sRGB downstream.
#598 no longer reproduces on main. Encoding the same buffer through
_encode_exportfor every non-greyscale entry inEXPORT_COLOR_SPACES, the TIFF carries a profile in all six and its description matches the PNG:That matches the later comment on the issue from someone who could not reproduce it either. Filed against 0.43.1, this is 0.52.0, so it looks fixed rather than absent, which is why it is worth pinning.
The test asserts both formats are tagged and that the descriptions agree. Removing
iccprofile=from the TIFF write fails six of the new cases, so it has teeth rather than only passing today.tests/test_export_icc.py12 passed. Export suites together 200 passed.ruff checkandruff format --checkclean. Windows 11, Python 3.14.7.Referencing #598 rather than closing it, since this adds no fix.