mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-09 22:24:06 +00:00
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.3275f853csplit 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). Against6179cf795, 13 fail, including every base space except DeviceGray, where zero is black. Againstb6f93a3ae, 19 fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv