feat: the Site cuts the empty strips at the top and bottom of a ready PNG sheet from price and print
Some checks failed
Build and deploy / Validate source (push) Successful in 6s
Build and deploy / Integration suite on a real stack (push) Failing after 7m43s
Build and deploy / Secret scan and release gate (push) Successful in 7s
Build and deploy / Publish images (push) Has been skipped

Step 2 of trimming empty strips (Marcus, 2026-11-18): the Site.

- The sheet check finds where the ink starts and ends (each map cell
  keeps its first and last ink row) and returns the empty strips.
- A ready PNG sheet whose strip passes 1 cm loses it but for 0,5 cm, as
  the layout keeps; its metres drop to what is left, and the cart sends
  trim_top_cm and trim_bottom_cm with the source, which the server prints
  without (06f4ec9). Spaces between artworks stay.
- The sheet's card says "Removemos N cm vazios do fim do arquivo.
  Cobrado: X m." (with several sheets or copies: "Esta folha fica com
  X m.").
- The thinnest stroke's place for the proof counts from where the cut
  starts.

Checked in Chromium against the page: a 100 cm UV sheet with art from 20
to 45 cm leaves 25,98 cm, a 3 m sheet (the tall-PNG path) 71 cm, two
sheets each say their own metres; the cart's production passes the
server model and prints 25,98 cm with the art whole.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-18 11:59:14 -03:00
parent 06f4ec9f20
commit 2d8d7c78b1
6 changed files with 50 additions and 6 deletions

View File

@@ -304,7 +304,13 @@ function analisarMapa(m){
porPerto.forEach(set=>{ if(set.size>1) encostadas+=set.size; });
const total=m.wPx*m.hPx;
// As faixas sem tinta no começo e no fim da folha (Marcus, 18/11/2026): cada
// célula guarda onde a tinta começa e termina, em pixels do mapa.
let topo=m.hPx, fim=-1;
for(let p=0;p<bits.length;p++) if(bits[p]){ if(m.y0[p]<topo) topo=m.y0[p]; if(m.y1[p]>fim) fim=m.y1[p]; }
return {
vazioTopoCm: fim<0 ? 0 : topo/m.pxPorCm,
vazioFimCm: fim<0 ? 0 : (m.hPx-1-fim)/m.pxPorCm,
dpi: Math.round(m.wPx/(m.larguraCm/2.54)),
artes: ilhas.length-residuos.length,
residuos: residuos.length,