From 2132fd96ca11cdf93332fc69802cb0399a982dca Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 1 Nov 2026 09:36:40 +0100 Subject: [PATCH] README: document the 40 Mpx image ceiling of go-gfx/gfx v0.37.0 Docs only; behaviour changed with the dependency bump already merged. Co-Authored-By: Claude Opus 5.5 --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 11f20ee..aaae41d 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,15 @@ pixel as Chrome and WeasyPrint do; WeasyPrint's `--dpi` is the same lever. A relative `src` resolves against `BaseURL`; an image that fails to fetch or decode is left out. +**Images above 40 megapixels.** Since `go-gfx/gfx` v0.37.0 the codec refuses an +image of more than `codec.DefaultMaxPixels` (40 million pixels, width times +height) from its header, before allocating anything: the size comes from the +file, and a compressed format describes a huge image in a few bytes. The second, +full-size decode of an `` described above is subject to it. Above the +ceiling it fails with `codec.ErrTooLarge`, and the embedded image is then the +engine's box-size bitmap instead of the full-size source (a source that +large is replaced, not dropped). There is no option to raise the ceiling here. + ### Rendering with no network access Stylesheets (``, `@import`) and `` images are the only places