Skip to content

Conformance: the JPEG 2000 rule counts colour channels as ISO 19005-2 6.2.8.3 does #792

In review

Description

@Tim81

Why

Jpeg2000Rule (VellumPdf.Conformance) checks ISO 19005-2 6.2.8.3 as veraPDF's PDF/A-2 profile does, not as the clause
reads (#418 is the general case). Two of its five checks count the wrong channels:

  • Test 1 reports a codestream whose component count (Csiz, or the JP2 ihdr NC) is not 1, 3 or 4. The clause limits
    the number of colour channels. A JP2 file whose channel definition box (cdef) declares one grey channel and one
    opacity channel has one colour channel and meets the clause, but the rule reports it.
  • Test 5 compares the bit depth of every channel. The clause asks for the same bit depth over the colour channels; an
    opacity channel of another depth is not covered. (The rule already compares depth without the sign bit, which matches
    ISO/IEC 15444-1 Table A.11, where the sign is separate from the depth.)

Which channels are colour channels is set by ISO/IEC 15444-1 I.5.3.6: without a cdef box the codestream holds colour
channels only; any auxiliary channel requires the box, whose type-0 entries are the colour channels. Both texts were
read on NEN Connect (neither is held in the repository).

Proposal

Count colour channels from cdef (type 0 entries), or all channels when there is no cdef box, for test 1 and test 5.
Check that tests 2 (exactly one APPROX 0x01 when there is more than one colour specification) and 3 (METH 1, 2 or 3)
apply whether or not the image dictionary has ColorSpace, as the clause does. Rewrite the class docs to cite the clause
and 15444-1 I.5.3.6, say where veraPDF differs (it counts all channels, and checks APPROX and METH only without
ColorSpace), and drop the sentence that the rule was checked only against veraPDF for these tests.

Acceptance

  • A JP2 with cdef grey + opacity: no test 1 finding; grey 8-bit + opacity 4-bit: no test 5 finding.
  • A JP2 with no cdef and 2 channels: test 1 finding. RGB + opacity of 16 bits with RGB at 8: no finding; RGB channels
    of different depths: finding.
  • Two colr boxes with APPROX 0 and an image dictionary that has ColorSpace: test 2 finding.
  • ConformanceCatalog and the parity tests against veraPDF updated, with each place veraPDF disagrees named in the test.

Split from #418 for v2.4 because #787 (the JP2 loader) applies the same clause in the same release.

Activity

  1. added 18 commits that reference this issue on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions