Skip to content

Commit

Permalink
Don't compress across bands (#39)
Browse files Browse the repository at this point in the history
This essentially re-introduces 7ed0d6f, but with a simpler
implementation. Some printers needed it after all.
  • Loading branch information
pdewacht committed Sep 10, 2019
1 parent ff68db0 commit 172c3bf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ void job::encode_page(const page_params &page_params,

for (int i = 1; i < lines && nextline(line); ++i) {
std::vector<uint8_t> 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);
}

Expand Down

0 comments on commit 172c3bf

Please sign in to comment.