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

@@ -531,6 +531,15 @@ function detalhesDaFolha(a,i,aberto){
'<summary>Ver o que o Prumo conferiu</summary>'+
linhas.map(l=>'<span>'+l+'</span>').join('')+'</details>';
}
// What the empty strips cut from a sheet were (aplicaCorte, Marcus 18/11/2026):
// with one sheet the line says what is charged; with several the total is
// rounded once, so it says what this sheet counts.
function textoCorte(x, sozinha){
const {topo, fim}=x.corte;
const onde=topo&&fim ? 'do começo e do fim' : topo ? 'do começo' : 'do fim';
return 'Removemos '+Math.round(topo+fim)+' cm vazios '+onde+' do arquivo. '+
(sozinha ? 'Cobrado: '+fmtM(cobrar(x.m))+' m.' : 'Esta folha fica com '+fmtM(x.m)+' m.');
}
function pintaFolha(){
if(!MODOS[modo]) return; // read after the customer left the product page
invalidaItemAtual();
@@ -549,6 +558,7 @@ function pintaFolha(){
if(lido){
medida='<div class="repMed"><b>'+n1(x.med.larg)+' × '+n1(x.med.alt)+' cm</b>'+
'<span>'+escapeHTML(extDe(x.f.name))+' · '+fmt(x.f.size)+'</span></div>'+
(x.corte? '<p class="repTxt">'+textoCorte(x, folhas.length===1 && (x.rep||1)===1)+'</p>' : '')+
(a? '<ul class="chips">'+chipsDaFolha(a,residuoAceito(x))+'</ul>'+avisosDaFolha(a,x.f.name,i,residuoAceito(x),true)+
(temAvisoFolha(x)?ajusteLinha(i,'data-ajuste'):'')+
detalhesDaFolha(a,i,x.detAberto) : '')+