Skip to content

test(export): cover ICC tagging on RGB TIFF exports - #910

Merged
marcinz606 merged 1 commit into
marcinz606:mainfrom
MohammedAlkindi:test/rgb-tiff-icc-coverage
Aug 19, 2026
Merged

test(export): cover ICC tagging on RGB TIFF exports#910
marcinz606 merged 1 commit into
marcinz606:mainfrom
MohammedAlkindi:test/rgb-tiff-icc-coverage

Conversation

@MohammedAlkindi

Copy link
Copy Markdown
Contributor

_encode_export branches 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_export for every non-greyscale entry in EXPORT_COLOR_SPACES, the TIFF carries a profile in all six and its description matches the PNG:

Same as Source  TIFF A98C | PNG A98C
sRGB            TIFF sRGB | PNG sRGB
Adobe RGB       TIFF A98C | PNG A98C
ProPhoto RGB    TIFF ROMM | PNG ROMM
P3 D65          TIFF sP3  | PNG sP3
Rec 2020        TIFF 2020 | PNG 2020

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.py 12 passed. Export suites together 200 passed. ruff check and ruff format --check clean. Windows 11, Python 3.14.7.

Referencing #598 rather than closing it, since this adds no fix.

`_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.
@marcinz606
marcinz606 merged commit b232cc9 into marcinz606:main Aug 19, 2026
1 check 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.

2 participants