docs(pdf): PNG budget wording (pixel cap bounds decoder memory); chore(memory): EVAL-013, journal, TODO 6.6 closed and 6.8 awaiting user

This commit is contained in:
bchanot committed 2026-10-11 15:06:12 +02:00
1 parent cb95627a11
commit 80e95ca61d
4 files changed
+21 -4

No files matched your search

+6 -3
View File
@@ -199,9 +199,12 @@ the pixel budget; a colour type and bit depth the PNG spec allows (0: 1 to
0 and no interlace (the archived logos are never interlaced, so Adam7 pass
sizes are not computed); an expected raw scanline size,
`(ceil(width × bits per pixel / 8) + 1) × height`, of at most 16 MiB, the
attachment cap the native inflater enforces, which is the effective budget
(4096² at 8-bit RGBA is 67 MB of scanlines and is refused; a 512 px wide
logo is under 1 MB); then the chunk list, which must end on an empty `IEND`
attachment cap the native inflater enforces (4096² at 8-bit RGBA is 67 MB
of scanlines and is refused; a 512 px wide logo is under 1 MB). That cap
bounds what is inflated, not what pdf-lib's decoder then allocates: the
decoder still expands any accepted image to a 32-bit RGBA buffer, so the
4096² pixel cap is what bounds memory (about 430 MB peak measured with four
4096² logos; real logos are 512 px wide). Then the chunk list, which must end on an empty `IEND`
that closes the file and may hold only the chunk types the decoder reads by
fixed offsets or by declared length (`PLTE`, `tRNS`, `IDAT`, `IEND`,
`gAMA`, `cHRM`, `sRGB`, `sBIT`, `pHYs`, `bKGD`): a second IHDR, an APNG