Skip to content

gamut-png: six files cite tRNS as §11.3.2.1, which the vendored spec gives to cHRM #604

Description

@justin13888

What

gamut-png cites the tRNS chunk as §11.3.2.1 in six files. The vendored PNG 3rd edition
(references/png/png-3.html) numbers tRNS §11.3.1.1 tRNS Transparency, and gives
§11.3.2.1 to cHRM Primary chromaticities and white point. A reader following the citation
lands on a different chunk's clause.

Sites (every one is a doc comment or a test's header; none affects behaviour):

  • crates/gamut-png/src/ancillary.rsWrittenPalette::trns
  • crates/gamut-png/src/encoder.rs — the truecolour tRNS sample-width comment
  • crates/gamut-png/src/reduce.rs — three sites (Reduced doc, the colour-key conditions, the
    transparent-first ordering rationale)
  • crates/gamut-png/tests/colour_key.rs — two sites
  • crates/gamut-png/tests/ancillary_colour_type.rs — the palette-alpha helper
  • crates/gamut-png/STATUS.md — the palette-optimization axis

The claims each citation supports are correct — §11.3.1.1 does say a truecolour tRNS is three
16-bit big-endian samples, does give a decoder exactly one transparent colour, and does make
entries past the end of a palette tRNS opaque. Only the number is wrong.

Why file it rather than fix it in passing

It touches six files across the encoder, the reducer and two test suites, none of which is on the
surface of the change that found it (#550, metadata preservation). A mechanical citation sweep is
its own review.

Suggested scope

Correct the number at every site, and consider whether the crate wants a cheap guard — the
sections it cites are stable and enumerable, so a check that every §11.3.x.y in the crate
resolves to a heading in the vendored HTML would stop the next one.

Found while auditing §11.3 citations for #550.

Activity

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions