Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

fixes #218

jonaswinkler713985f2592e
diff --git a/src/documents/parsers.py b/src/documents/parsers.py
index cbbb912de..725e605a2 100644
--- a/src/documents/parsers.py
+++ b/src/documents/parsers.py
@@ -117,6 +117,7 @@ def run_convert(input_file,
trim=False,
type=None,
depth=None,
+ auto_orient=False,
extra=None,
logging_group=None):
@@ -134,6 +135,7 @@ def run_convert(input_file,
args += ['-trim'] if trim else []
args += ['-type', str(type)] if type else []
args += ['-depth', str(depth)] if depth else []
+ args += ['-auto-orient'] if auto_orient else []
args += [input_file, output_file]
logger.debug("Execute: " + " ".join(args), extra={'group': logging_group})
diff --git a/src/paperless_tesseract/parsers.py b/src/paperless_tesseract/parsers.py
index 80e200f27..4da5af2c0 100644
--- a/src/paperless_tesseract/parsers.py
+++ b/src/paperless_tesseract/parsers.py
@@ -60,6 +60,7 @@ class RasterisedDocumentParser(DocumentParser):
alpha="remove",
strip=True,
trim=False,
+ auto_orient=True,
input_file="{}[0]".format(document_path),
output_file=out_path,
logging_group=self.logging_group)
@@ -84,6 +85,7 @@ class RasterisedDocumentParser(DocumentParser):
alpha="remove",
strip=True,
trim=False,
+ auto_orient=True,
input_file=gs_out_path,
output_file=out_path,
logging_group=self.logging_group)