From ba85168c093fd0cd05d252793baab9dd296b82b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Fri, 27 Nov 2026 15:03:36 -0300 Subject: [PATCH] fix: parts of 10 m are the code's default too, not only the stack's A stack without PRINT_PART_CM (the local one and CI) cut films in 15 m parts, 4,8 GB decoded, which FlexiPRINT refuses (Marcus, 2026-11-18). The comments that still said 15 m now say a part. Co-Authored-By: Claude Opus 5.5 --- app/hotfolder.py | 4 ++-- app/printjobs.py | 2 +- app/printpng.py | 10 ++++++---- tests/test_proof_cut.py | 7 ++++--- web/kanban.js | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/app/hotfolder.py b/app/hotfolder.py index f85a798..02fa535 100644 --- a/app/hotfolder.py +++ b/app/hotfolder.py @@ -4,8 +4,8 @@ FlexiPRINT watches 3. Imprimindo/// and takes a file out of it when it rips. When the operator pulls a card to Imprimindo, its files go, as a copy, into its machine's folder for the item's contraction class; a premium item always goes to PREMIUM, whichever class it carries; -the order's own file stays in its stage folder. A film over 15 m is several -parts (item 13): all on the same machine, in order. A machine's folder holds +the order's own file stays in its stage folder. A film longer than a part +(10 m) is several parts (item 13): all on the same machine, in order. A machine's folder holds as many files at once as it has places in Imprimindo (machines.places, three since 2026-11-17); the next is written when Flexi takes one. diff --git a/app/printjobs.py b/app/printjobs.py index 126c2c9..266333b 100644 --- a/app/printjobs.py +++ b/app/printjobs.py @@ -7,7 +7,7 @@ plus a margin; CLAIM_TIMEOUT for a claim made before deadlines existed) is assumed to belong to a worker that died and is taken again. The result is a 300 DPI PNG (item 13, app/printpng.py), or its parts for a -film over 15 m: ordinary upload rows owned by an identity derived from the +film longer than a part (10 m): ordinary upload rows owned by an identity derived from the order, already marked clean, since their only inputs are artwork that passed the malware scan and the bytes are written here. dtf_local.print_parts lists them in order. The operator still decides whether they become the final diff --git a/app/printpng.py b/app/printpng.py index 0552897..b963837 100644 --- a/app/printpng.py +++ b/app/printpng.py @@ -19,8 +19,9 @@ holds a whole sheet: the film is composed and written in bands of rows. - Loose artwork is small: each file is decoded, turned and scaled to its place once, and copied into every band it crosses. -A layout longer than 15 m leaves as parts of up to 15 m (Dropstar, -2026-10-30), DTF-7-item-1-p3.png, each with its footer saying which part it +A layout longer than a part leaves as parts of up to PART_CM, 10 m since +Marcus's 18/11 answer (Flexi opens up to 4 GB per image; Dropstar, +2026-10-30, was 15 m), DTF-7-item-1-p3.png, each with its footer saying which part it is. Loose artwork is cut where no piece crosses; a finished sheet between copies, or else in a clear band of its own pixels, and through the artwork only when it has none (#136). @@ -41,8 +42,9 @@ from .printtiles import Pyramid DPI = 300 PX_PER_CM = DPI / 2.54 -# Parts of up to 15 m, 6732 x 177165 px (Dropstar, 2026-10-30). -PART_CM = Decimal(os.environ.get('PRINT_PART_CM', '1500')) +# Parts of up to 10 m (Marcus, 2026-11-18): a 15 m part, 6732 x 177165 px, is +# 4,8 GB decoded and FlexiPRINT refuses it. PRINT_PART_CM overrides it. +PART_CM = Decimal(os.environ.get('PRINT_PART_CM', '1000')) # A cut through artwork only when no gap between pieces is this close to the limit. CUT_SEARCH_CM = Decimal('200') BAND_ROWS = 512 diff --git a/tests/test_proof_cut.py b/tests/test_proof_cut.py index 54e40a8..83fcf46 100644 --- a/tests/test_proof_cut.py +++ b/tests/test_proof_cut.py @@ -48,9 +48,10 @@ class RenderLimitTests(unittest.TestCase): return {'production': {'height_cm': height, 'placements': [ {'y_cm': 0, 'length_cm': height, 'source_index': 0}]}} self.assertEqual(render_seconds(film(800)), RENDER_SECONDS) - # A film in parts gets one part more: a cut moved to a clear band (#136). - self.assertEqual(render_seconds(film(2359.2)), 3 * RENDER_SECONDS) - self.assertEqual(render_seconds(film(4600)), 5 * RENDER_SECONDS) + # Parts of 10 m (Marcus, 2026-11-18), and a film in parts gets one + # part more: a cut moved to a clear band (#136). + self.assertEqual(render_seconds(film(2359.2)), 4 * RENDER_SECONDS) + self.assertEqual(render_seconds(film(4600)), 6 * RENDER_SECONDS) self.assertEqual(render_seconds({'mode': 'file'}), RENDER_SECONDS) diff --git a/web/kanban.js b/web/kanban.js index 5d89a3f..fe7f080 100644 --- a/web/kanban.js +++ b/web/kanban.js @@ -626,7 +626,7 @@ async function syncFolder(force=false){ if(stages)await makeStageFolders(); const held=stages?[...new Set([...FOLDER.saved.values()].filter(r=>!r.review).map(r=>r.order).filter(Boolean))].slice(-1000):[]; const {files,states,receipts=[],reviews=[]}=await api('/queue/folder',{early:stages,held,since:stages?FOLDER.since||await folderSince():null}); - // By file: an item over 15 m is several parts (item 13), each its own file. + // By file: an item longer than a part (10 m) is several parts (item 13), each its own file. const wanted=new Map(files.map(f=>[f.upload_id,f])); const where=stages?'“'+FOLDER.handle.name+'”':'a pasta de downloads'; let removed=0, moved=0, saved=0;