From 70837e2e069af8b640e49a5fea546f0413588e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Fri, 27 Nov 2026 09:15:23 -0300 Subject: [PATCH] fix: a PNG the phone cannot open whole is read in bands, not charged as a manual check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A 57 MB sheet failed to decode on a phone (out of memory), so the Site took it for a file the browser cannot read: +R$ 2,00 a metre and "O navegador não abre PNG". Its size was already known; it now goes the large-file way. Co-Authored-By: Claude Opus 5.5 (1M context) --- web/site-pdf.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/site-pdf.js b/web/site-pdf.js index 691e5d3..af5fe09 100644 --- a/web/site-pdf.js +++ b/web/site-pdf.js @@ -339,7 +339,10 @@ function medirFolha(file){ const L=larguraFilme(), measure={larg:L,alt:+(d.h/d.w*L).toFixed(1), fonte:'dimensões do arquivo',dpiFolha:Math.round(d.w/(L/2.54)),px:d.w}; if(d.h>32767 || file.size>GRANDE_BYTES) return res({...measure,grande:true,tall:d.h>32767}); - carregarImagem(file).then(img=>res(img&&img.width?{...measure,fonte:'proporção da imagem'}:null)); + // A PNG the phone cannot open whole (out of memory, a 57 MB sheet on + // 26/11) is read in bands like a large one, never sent to the manual + // check: its size is already known. + carregarImagem(file).then(img=>res(img&&img.width?{...measure,fonte:'proporção da imagem'}:{...measure,grande:true})); }).catch(()=>res({rejected:true,reason:'Não foi possível ler o PNG. Exporte novamente.'})); return; }