From 172c3bf87b100945312f1b83c0b963e626795b4c Mon Sep 17 00:00:00 2001 From: Peter De Wachter Date: Mon, 20 May 2019 00:08:03 +0200 Subject: [PATCH] Don't compress across bands (#39) This essentially re-introduces 7ed0d6f, but with a simpler implementation. Some printers needed it after all. --- src/job.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/job.cc b/src/job.cc index 440fc6d..6f088ae 100644 --- a/src/job.cc +++ b/src/job.cc @@ -105,10 +105,12 @@ void job::encode_page(const page_params &page_params, for (int i = 1; i < lines && nextline(line); ++i) { std::vector encoded = encode_line(line, reference); - if (!block.line_fits(encoded.size())) { + if (block.line_fits(encoded.size())) { + block.add_line(std::move(encoded)); + } else { block.flush(out_); + block.add_line(encode_line(line)); } - block.add_line(std::move(encoded)); std::swap(line, reference); }