From ee35e28aa6adf52029b8eb478b3a2497d87a4c44 Mon Sep 17 00:00:00 2001 From: deeplow Date: Thu, 21 Dec 2023 13:03:55 +0000 Subject: [PATCH] Disable image compression when saving PDF Some tests [1] lead to the conclusion that ocr_compression does the same to the file (performance and size-wise) to the file as deflating images when saving the file. However, both methods active do add a bit of extra time. For this reason we're disabling the image deflation (default option). [1]: https://github.com/freedomofpress/dangerzone/pull/622#discussion_r1434042296 --- dangerzone/conversion/pixels_to_pdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dangerzone/conversion/pixels_to_pdf.py b/dangerzone/conversion/pixels_to_pdf.py index 2c3fd6d..3930ac4 100644 --- a/dangerzone/conversion/pixels_to_pdf.py +++ b/dangerzone/conversion/pixels_to_pdf.py @@ -86,7 +86,7 @@ class PixelsToPDF(DangerzoneConverter): else: safe_pdf_path = f"/safezone/safe-output-compressed.pdf" - safe_doc.save(safe_pdf_path, deflate_images=True) + safe_doc.save(safe_pdf_path) async def main() -> int: