Skip to content

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

Convert Density

Brian Martin52c5aafb3fe3
diff --git a/src/documents/consumer.py b/src/documents/consumer.py
index bac93647e..df1a73cb3 100644
--- a/src/documents/consumer.py
+++ b/src/documents/consumer.py
@@ -53,6 +53,7 @@ class Consumer(object):
UNPAPER = settings.UNPAPER_BINARY
CONSUME = settings.CONSUMPTION_DIR
THREADS = int(settings.OCR_THREADS) if settings.OCR_THREADS else None
+ DENSITY = int(settings.CONVERT_DENSITY) if settings.CONVERT_DENSITY else 300
DEFAULT_OCR_LANGUAGE = settings.OCR_LANGUAGE
@@ -158,7 +159,7 @@ class Consumer(object):
pnm = os.path.join(tempdir, "convert-%04d.pnm")
run_convert(
self.CONVERT,
- "-density", "300",
+ "-density", self.DENSITY,
"-depth", "8",
"-type", "grayscale",
doc, pnm,
diff --git a/src/paperless/settings.py b/src/paperless/settings.py
index db74d9cea..ad6084711 100644
--- a/src/paperless/settings.py
+++ b/src/paperless/settings.py
@@ -191,6 +191,7 @@ GNUPG_HOME = os.getenv("HOME", "/tmp")
CONVERT_BINARY = os.getenv("PAPERLESS_CONVERT_BINARY")
CONVERT_TMPDIR = os.getenv("PAPERLESS_CONVERT_TMPDIR")
CONVERT_MEMORY_LIMIT = os.getenv("PAPERLESS_CONVERT_MEMORY_LIMIT")
+CONVERT_DENSITY = os.getenv("PAPERLESS_CONVERT_DENSITY")
# Unpaper
UNPAPER_BINARY = os.getenv("PAPERLESS_UNPAPER_BINARY", "unpaper")