mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-09 12:32:52 +00:00
The decoded-image cache stored a failed decode as an empty entry and read an empty entry as a miss, so a picture or stencil mask that doesn't decode (damaged data, a JPX or JBIG2 stream its decoder refuses) was decoded again at every draw, and at every tile, preview and zoom of a render worker that shares the cache. The cache now keeps a failure for its key, with the warnings the decode reported; a later draw reports the same warnings and gets nothing, as the decode did. A failure counts 128 bytes towards the cache's 64 MiB budget. A failure the page's JBIG2 allowance may have caused (ContentTruncated, or the allowance spent) isn't kept, since the next page starts afresh. Successful decodes are cached as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn