Skip to content

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

Tweaks the resizing based on testing

Trenton H7273a8c7a564
diff --git a/src/documents/barcodes.py b/src/documents/barcodes.py
index 597f228f3..82b8afecc 100644
--- a/src/documents/barcodes.py
+++ b/src/documents/barcodes.py
@@ -177,16 +177,15 @@ def scan_file_for_barcodes(
# See: https://github.com/paperless-ngx/paperless-ngx/issues/2385
# TLDR: zbar has issues with larger images
width, height = pillow_img.size
- if width > 512:
- scaler = ceil(width / 512)
+ if width > 1024:
+ scaler = ceil(width / 1024)
new_width = int(width / scaler)
new_height = int(height / scaler)
pillow_img = pillow_img.resize((new_width, new_height))
width, height = pillow_img.size
-
- if height > 1024:
- scaler = ceil(height / 1024)
+ if height > 2048:
+ scaler = ceil(height / 2048)
new_width = int(width / scaler)
new_height = int(height / scaler)
pillow_img = pillow_img.resize((new_width, new_height))