Skip to content

QA Report: TIFF sample metadata is structurally inconsistent #2385

Description

@xsscx

QA Report

2026-09-04 02:15:49 UTC

gh repo clone InternationalColorConsortium/ICS-POC

Finding

TIFF sample metadata is structurally inconsistent

Raw tiffdump output shows PhotometricInterpretation=MinIsBlack or
MinIsWhite with 6, 36, or 81 samples, but no stored tag 338
(ExtraSamples). TIFF 6.0 uses ExtraSamples to account for samples beyond
the number implied by the photometric model. libtiff therefore warns and
repairs the effective in-memory directory.

Affected paths:

  • HybridMultiSpectralEncoding/Data/smCows380_5_780.tif
  • HybridMultiSpectralEncoding/Results/Ref_smCows.tif
  • SpectralEncoding/Data/smCows380_5_780.tif
  • SpectralEncoding/Results/MS6_smCows.tif
  • SpectralEncoding/Results/Ref_smCows.tif
  • SpectralEncoding/Results/Spec_ms6Cows.tif
  • SpectralEncoding/Results/Spec_smCows.tif

The two 81-band input paths are byte-identical. The other five paths are
generated outputs.

iccApplyProfiles derives extra samples only when a destination parent space
exists and differs from the destination space. Direct spectral and N-channel
destinations keep nExtraSamples=0. They then fall through to grayscale
photometric models, and CTiffImg::Create() omits tag 338.

Relevant code:

  • /opt/iccDEV/Tools/CmdLine/IccApplyProfiles/iccApplyProfiles.cpp:521-571
  • /opt/iccDEV/Tools/CmdLine/IccApplyProfiles/TiffImg.cpp:454-519
  • /opt/iccDEV/Tools/CmdLine/IccSpecSepToTiff/iccSpecSepToTiff.cpp:666-700

The sibling iccSpecSepToTiff code already passes nSamples - 1 unspecified
extra samples for its spectral TIFF output.

One-line reproduction listing every warning path:

b=/opt/iccDEV/Build/Tools/IccTiffDump/iccTiffDump; bash -O globstar -c 'for f in /opt/ICS-POC/**/*.tif; do out=$("'$b'" "$f" 2>&1); case "$out" in *"Sum of Photometric type-related color channels"*) printf "%s\n" "$f";; esac; done'

One-line raw-tag reproduction for a representative generated file:

tiffdump /opt/ICS-POC/SpectralEncoding/Results/Spec_smCows.tif | grep -E 'Photometric|SamplesPerPixel|ExtraSamples|ICC Profile'

Expected evidence is Photometric=1, SamplesPerPixel=36, an ICC profile,
and no ExtraSamples line.

Recommended action:

  1. Define the intended TIFF container contract for ICC.2 spectral and direct
    N-channel image data. Do not merely silence the libtiff handler.
  2. If the existing iccSpecSepToTiff convention is authoritative, emit
    EXTRASAMPLE_UNSPECIFIED for every sample beyond the first from
    iccApplyProfiles as well.
  3. Regenerate the shared 81-band source fixture with matching metadata.
  4. Add raw tiffdump assertions and a no-libtiff-warning test for direct
    6-, 36-, and 81-channel outputs.
  5. Confirm with maintainers that labeling bands 2..N as unspecified extras is
    compatible with the embedded ICC.2 profile describing all N samples.

Activity

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

Metadata

Metadata

Labels

BuildBuild system, CMake, compiler, or packagingCodexCodex use indicated by MaintainerImgImage Handling & ProcessingQAMaintainer indicates topic of Quality AssuranceSpecICC specification, tag, color-space, or schema scopeTestingCTest, regression, or test coverageciContinuous integration workflow changesgpt-daybreak-blueMaintainer indicates use of Codex gpt-daybreak-blue Modelneeds-triageMaintainer triage requiredpawgMaintainer indicates subject matter with spected to Profile Assessment Working Group (PAWG)

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions