fix: the print file is written over twice as fast, and a file finished after Prova OK queues its order (#81)
Some checks failed
Build and deploy / Validate source (push) Successful in 1m41s
Build and deploy / Publish images (push) Has been cancelled
Build and deploy / Secret scan and release gate (push) Has been cancelled
Build and deploy / Integration suite on a real stack (push) Has been cancelled

#81's 91,5 m took 6 hours to generate. The PNG writer ran Pillow's row filters
and then deflate at level 6; no filter at level 1 gives the same size in under
half the time, for the file and the viewer's strips alike (1 m: 34 s -> 13 s).

Its Prova OK came while the file was still being generated, so the order stayed
in Arte recebida. The approval now also runs when the file finishes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-11-25 09:40:13 -03:00
parent a1fad7698a
commit 449b45b520
8 changed files with 111 additions and 69 deletions

View File

@@ -78,8 +78,13 @@ class Pyramid:
self._feed(level + 1, small)
def _strip(self, level, image):
# The print file's own writer, the fast one (imported here: printpng
# imports this module).
from .printpng import PngWriter
out = io.BytesIO()
image.save(out, 'PNG', compress_level=1)
writer = PngWriter(out, image.width, image.height)
writer.band(image)
writer.close()
self.emit(level, self.count[level], out.getvalue())
self.count[level] += 1