Skip to content

Fix: iccV5DspObsToV4Dsp emits rXYZ/gXYZ/bXYZ as XYZType, not s15Fixed16ArrayType (#1362)#1364

Merged
xsscx merged 1 commit into
InternationalColorConsortium:masterfrom
colourbill-ctrl:fix-1362-v5dspobs-xyztype
Jun 15, 2026
Merged

Fix: iccV5DspObsToV4Dsp emits rXYZ/gXYZ/bXYZ as XYZType, not s15Fixed16ArrayType (#1362)#1364
xsscx merged 1 commit into
InternationalColorConsortium:masterfrom
colourbill-ctrl:fix-1362-v5dspobs-xyztype

Conversation

@colourbill-ctrl

Copy link
Copy Markdown
Contributor

Closes #1362.

Problem

iccV5DspObsToV4Dsp created the red/green/blue matrix-column tags (rXYZ/gXYZ/bXYZ, a.k.a. red/green/blueColorantTag) as CIccTagS15Fixed16, which serializes with the type signature 'sf32' (s15Fixed16ArrayType). ICC.1 §9.2.46 / §9.2.31 / §9.2.4 require these tags to be XYZType ('XYZ ', §10.31) — an array of one XYZNumber.

The numeric data was correct (XYZType and a 3-element s15Fixed16ArrayType share the same 20-byte layout), but the wrong type signature made the profile NonCompliant and unreadable by consumers keying on the spec type — e.g. dynamic_cast<CIccTagXYZ*>(FindTag(icSigRedMatrixColumnTag)) returned nullptr in the PAWG quality metrics (IccQualityMetrics.h).

Fix

CIccTagXYZ* primaryXYZ = new CIccTagXYZ;            // 'XYZ ', one XYZNumber
(*primaryXYZ)[0].X = icDtoF(out[0]);
(*primaryXYZ)[0].Y = icDtoF(out[1]);
(*primaryXYZ)[0].Z = icDtoF(out[2]);
pIcc->AttachTag(icSigRedColorantTag, primaryXYZ);

(same for green/blue).

Verification

Regenerated LCDDisplayCat8Obs.icc from the committed inputs:

Before After
rXYZ/gXYZ/bXYZ on-disk type sf32 (73663332) XYZ (58595A20)
iccDumpProfile type s15Fixed16ArrayType XYZArrayType
colorant NonCompliant warning Invalid tag type ×3 gone
red primary X=0.5150 Y=0.2760 Z=-0.0035 (preserved)

A paired regression test (assert the three matrix-column tags serialize as 'XYZ ') will follow per the fix/test split.

🤖 Generated with Claude Code

…16ArrayType (InternationalColorConsortium#1362)

The red/green/blue matrix-column tags (rXYZ/gXYZ/bXYZ, a.k.a.
red/green/blueColorantTag) were created as CIccTagS15Fixed16, serializing with
the type signature 'sf32' (s15Fixed16ArrayType). ICC.1 9.2.46 / 9.2.31 / 9.2.4
require these tags to be XYZType ('XYZ ', 10.31) -- an array of one XYZNumber.
The numeric data was correct (XYZType and a 3-element s15Fixed16ArrayType share
the same 20-byte layout), but the wrong type signature made the profile
NonCompliant and unreadable by consumers keying on the spec type, e.g.
dynamic_cast<CIccTagXYZ*>(FindTag(icSigRedMatrixColumnTag)) returned nullptr in
the PAWG quality metrics.

Create CIccTagXYZ (one XYZNumber, X/Y/Z) so the tags carry the correct 'XYZ '
type signature. Verified: regenerated LCDDisplayCat8Obs.icc now reports
XYZArrayType for all three tags with the primaries preserved (red
X=0.5150 Y=0.2760 Z=-0.0035), and the colorant tag-type NonCompliant warnings
are gone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added Tools Command-line tool or GUI tool changes Source C or C++ source code changes labels Jun 15, 2026

@xsscx xsscx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

2026-06-15 22:00:24 UTC

@xsscx xsscx added the Merge Ready Approved, mergeable, and all CI checks passed label Jun 15, 2026
@xsscx xsscx merged commit ba3f92d into InternationalColorConsortium:master Jun 15, 2026
30 checks passed
@colourbill-ctrl

Copy link
Copy Markdown
Contributor Author

Cross-reference for the archive: the regression guard for this fix had a detour. The paired test PR #1366 merged but its auto-merge silently dropped all four #1362 test artifacts (script, two .icc fixtures, CTest registration) when resolving the Testing/CMakeLists.txt conflict — so this producer fix (CIccTagXYZ / 'XYZ ') briefly sat on master with no regression test. It was restored via #1368 (00f04e1, 30 checks green). Master now carries the fix and the guard. Timeline on #1366.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merge Ready Approved, mergeable, and all CI checks passed Source C or C++ source code changes Tools Command-line tool or GUI tool changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iccV5DspObsToV4Dsp writes rXYZ/gXYZ/bXYZ matrix-column tags as s15Fixed16ArrayType ('sf32') instead of XYZType ('XYZ ')

2 participants