Files
pdfcraft/apps
mtlcl410andClaude Opus 5.5 c709dd99ec M2: indices past a short Indexed table draw black in every base space, and an image with no lookup table is not drawn (ISO 32000-2 8.6.6.3)
Seven readers were compared on synthetic files. Most draw the entries a
short table holds and black past them, and none draws an image whose
lookup is missing.
- Indexed::new keeps how many entries the table holds in full. Indices
  at or past that are set to black after conversion, so DeviceCMYK,
  ICCBased, Separation, DeviceN and Lab come out black too (zero bytes
  gave white, or blue in Lab). Fill and stroke colours follow the same
  rule. An incomplete last entry counts as missing.
- A lookup that is missing, null, a number, or a stream that does not
  decode (or decodes to nothing although it holds data) is no table.
  ColorSpace::new_allowing_tableless builds such a space marked
  tableless (for the resource cache and ImageXObject::new only), and
  the image is skipped with MalformedIndexedImage. A cs/CS colour in it
  keeps the upstream DeviceGray fallback with ColorFallback. Every other
  caller still gets None, as upstream.
- hival clamping and truncation are unchanged, and so is case C.
- The warning now reads "an image with a malformed Indexed colour table
  may be drawn wrongly or not at all".
- vendor/README.md: the patch (60) row is one line again. 3275f853c
  split it.

Tests: indexed_lookup.rs now has 25 tests, including one per base space
(DeviceGray, DeviceCMYK, Lab, Separation, DeviceN, and ICCBased N=4
drawn through its alternate). Against 6179cf795, 13 fail, including
every base space except DeviceGray, where zero is black. Against
b6f93a3ae, 19 fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-11-02 07:32:46 +08:00
..