mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-10 21:11:52 +00:00
An image in [/Indexed /DeviceRGB 7 <FF0000 00FF00>] was drawn entirely black, indices 0 and 1 included. The interpreter rejected the colour space when the table ran out, and the image fell back to DeviceGray, so its index values were painted as near-black grey levels. ISO 32000-2 8.6.6.3 says hival "shall be an integer", no greater than 255, and the table "shall be m x (hival + 1) bytes long". An image whose Indexed space breaks this (hival not an integer in 0..=255, or a lookup missing or shorter than needed) is now not drawn, and the render reports RenderWarning::MalformedIndexedImage once per page; pdfcraft-cli render prints it. A longer table is still fine. Inline images, including one naming such a space as a resource, are skipped the same way. Fill and stroke colours in such a space go through a different path and are unchanged. Vendored hayro-interpret patch (60), recorded in vendor/README.md. Tests: crates/render/tests/it/indexed_lookup.rs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175FWj4xFhMhSH3UpMU8DSC