Skip to content

Decode icStatusCMM in tool/connect error messages (#1322, #1323)#1324

Merged
ChrisCoxArt merged 1 commit into
InternationalColorConsortium:masterfrom
colourbill-ctrl:fix-1322-1323-cmm-status-diagnostics
Jun 12, 2026
Merged

Decode icStatusCMM in tool/connect error messages (#1322, #1323)#1324
ChrisCoxArt merged 1 commit into
InternationalColorConsortium:masterfrom
colourbill-ctrl:fix-1322-1323-cmm-status-diagnostics

Conversation

@colourbill-ctrl

Copy link
Copy Markdown
Contributor

Summary

Investigation of #1322 and #1323 found both reported failures are status 2 = icCmmStatBadSpaceLink — a chain-level color-space mismatch, not a profile-validity problem. The rejections are correct, expected behavior; the QA-generated commands chain profiles whose color spaces cannot connect. The actionable defect was the diagnostics:

Root cause detail

#1323: input data cmykGrays.txt is CMYK (4ch); the first chain profile Spec380_10_730-D50_2deg.icc is a spac-class spectral reference profile with device space nc0024 (24-channel spectral reflectance) and an empty colorimetric PCS. CIccNamedColorCmm::AddXform correctly returns icCmmStatBadSpaceLink (IsCompatSpace(CMYK, nc0024) and IsNChannelCompat both false). This profile is used only as a -PCC argument in legitimate tests, never as a chain profile.

#1322: the command passes first_transform = 0, so the CMM takes profile 1 (Spec380_10_730-D50_2deg.icc) in the destination direction (rs0024 → nc0024, so m_nLastSpace = nc0024); profile 2 (Lab_float-F11_2deg-MAT.icc) is then taken in the input direction with source = device Lab. IsCompatSpace(nc0024, Lab) is false → icCmmStatBadSpaceLink. The iccDumpProfile warnings on that profile (empty A2B3/B2A3) are unrelated.

Changes

  • Tools/CmdLine/IccApplyToLink/iccApplyToLink.cpp: replace Invalid Profile(N) with Error - Unable to add '<file>' to transform chain (status N: <name>) via the existing CIccCmm::GetStatusText, plus an explanatory line for icCmmStatBadSpaceLink; also decode the Begin() failure status.
  • IccConnect/IccLibConnect/IccConnect.cpp: append GetStatusText(stat) to the four AddXform failed messages and three Begin() failed messages.
  • IccProfLib/IccCmm.cpp: add the missing icCmmStatUnsupported case to CIccCmm::GetStatusText (the enum comment asks for the switch to be kept in sync).

Message text only — no behavior or exit-code changes.

Verification

Fixes #1322. Fixes #1323.

🤖 Generated with Claude Code

…Consortium#1322, InternationalColorConsortium#1323)

iccApplyToLink reported any CIccCmm::AddXform failure as
"Invalid Profile(N)" and the IccConnect stage loop reported
"AddXform failed ... (status N)" with a bare number. Both misled
triage when the actual failure was icCmmStatBadSpaceLink (2) - a
chain-level color space mismatch with a structurally valid profile.

- iccApplyToLink: report "Unable to add <file> to transform chain
  (status N: <name>)" via CIccCmm::GetStatusText, with an extra hint
  for bad space links; decode the Begin() status too.
- IccConnect.cpp: append GetStatusText(stat) to the four AddXform
  failure messages and three Begin() failure messages.
- CIccCmm::GetStatusText: add missing icCmmStatUnsupported case.

No behavior change; message text only. Exit codes unchanged.
Verified against the InternationalColorConsortium#1322/InternationalColorConsortium#1323 repro commands and RunTests.sh.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@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-12 17:33:24 UTC

@ChrisCoxArt ChrisCoxArt merged commit 9adf63d into InternationalColorConsortium:master Jun 12, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Source C or C++ source code changes Tools Command-line tool or GUI tool changes

Projects

None yet

3 participants