From 5e44ba49b8eb019b37962c1b7f6e8c94082db75e Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Mon, 26 May 2025 22:26:14 +0300 Subject: [PATCH] refactor --- lib/templates/process_document.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/templates/process_document.rb b/lib/templates/process_document.rb index 8ee1dff5..bba7e1e4 100644 --- a/lib/templates/process_document.rb +++ b/lib/templates/process_document.rb @@ -118,10 +118,10 @@ module Templates page = page.copy(interpretation: :srgb) - bitdepth = 2**page.stats.to_a[1..3].pluck(2).uniq.size - data = if format == FORMAT + bitdepth = 2**page.stats.to_a[1..3].pluck(2).uniq.size + page.write_to_buffer(format, compression: 7, filter: 0, bitdepth:, palette: true, Q: bitdepth == 8 ? Q : 5, dither: 0) else