From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Thu, 19 Jan 2023 16:19:21 +0000 (-0800) Subject: Tweaks the resizing based on testing X-Git-Tag: v1.12.0-beta.rc0~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7273a8c7a5649de39503d8783d0dcb89883eb4db;p=thirdparty%2Fpaperless-ngx.git Tweaks the resizing based on testing --- diff --git a/src/documents/barcodes.py b/src/documents/barcodes.py index 597f228f36..82b8afecc9 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))