From 3b040d558dac54880d61f6fb24ec3ca745f8994d Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Fri, 24 Apr 2026 18:35:29 +0300 Subject: [PATCH] adjust compression --- 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 6b40a502..f4690fe5 100644 --- a/lib/templates/process_document.rb +++ b/lib/templates/process_document.rb @@ -69,7 +69,7 @@ module Templates bitdepth = 2**image.stats.to_a[1..3].pluck(2).uniq.size - io = StringIO.new(image.write_to_buffer(FORMAT, compression: 7, filter: 0, bitdepth:, + io = StringIO.new(image.write_to_buffer(FORMAT, compression: 6, filter: 0, bitdepth:, palette: true, Q: Q, dither: 0)) ActiveStorage::Attachment.create!( @@ -141,7 +141,7 @@ module Templates 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:, + page.write_to_buffer(format, compression: 6, filter: 0, bitdepth:, palette: true, Q: Q, dither: 0) else page.write_to_buffer(format, interlace: true, Q: JPEG_Q)