From 7116ebe50a53b16bf4d8fffda711fb0ef4bfc601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Tue, 29 Sep 2026 15:25:13 -0300 Subject: [PATCH] feat: preview and check large PNG sheets by reading them as a stream A large sheet had no preview and no automatic check of pieces, residue, gaps and background, because decoding it whole would crash the browser. A PNG over 150 MB is now inflated as a stream (DecompressionStream) and unfiltered row by row, keeping every n-th pixel: a 600-pixel-wide copy in about 100 MB of memory whatever the file's size (6.6 s for 500 MB, 22.7 s for 2.4 GB of random pixels, identical to Pillow's output for RGB, RGBA, grey, grey+alpha, palette and 16-bit). The copy is the preview and what the sheet check reads; the grade still comes at once from the header. The preview note promising a server-side re-nesting that does not exist is removed. Co-Authored-By: Claude Opus 5.5 --- web/index.html | 1 - web/site-pdf.js | 111 +++++++++++++++++++++++++++++++++++++++++++++ web/site-upload.js | 20 ++++++-- 3 files changed, 128 insertions(+), 4 deletions(-) diff --git a/web/index.html b/web/index.html index a4f9c6d..2f2f0ac 100644 --- a/web/index.html +++ b/web/index.html @@ -1050,7 +1050,6 @@ footer a:hover{color:var(--laranja2)} —
-

Prévia. O encaixe final é refeito no servidor e nunca sai pior.