From 743ce1dc14b2ad53123bb1aad1a9bed66192c496 Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Mon, 26 Oct 2020 01:05:23 +0100 Subject: [PATCH] better thumbnail generation for smaller files --- src/paperless_tesseract/parsers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/paperless_tesseract/parsers.py b/src/paperless_tesseract/parsers.py index fd7077834..eeca540b1 100644 --- a/src/paperless_tesseract/parsers.py +++ b/src/paperless_tesseract/parsers.py @@ -51,7 +51,8 @@ def get_thumbnail(self): try: run_convert( self.CONVERT, - "-scale", "500x5000", + "-density", "300", + "-scale", "500x5000>", "-alpha", "remove", "-strip", "-trim", "{}[0]".format(self.document_path), @@ -76,7 +77,8 @@ def get_thumbnail(self): # then run convert on the output from gs run_convert( self.CONVERT, - "-scale", "500x5000", + "-density", "300", + "-scale", "500x5000>", "-alpha", "remove", "-strip", "-trim", gs_out_path,