mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-10 16:46:50 +01:00
Tweaks the resizing based on testing
This commit is contained in:
parent
4195d5746f
commit
7273a8c7a5
1 changed files with 4 additions and 5 deletions
|
|
@ -177,16 +177,15 @@ def scan_file_for_barcodes(
|
||||||
# See: https://github.com/paperless-ngx/paperless-ngx/issues/2385
|
# See: https://github.com/paperless-ngx/paperless-ngx/issues/2385
|
||||||
# TLDR: zbar has issues with larger images
|
# TLDR: zbar has issues with larger images
|
||||||
width, height = pillow_img.size
|
width, height = pillow_img.size
|
||||||
if width > 512:
|
if width > 1024:
|
||||||
scaler = ceil(width / 512)
|
scaler = ceil(width / 1024)
|
||||||
new_width = int(width / scaler)
|
new_width = int(width / scaler)
|
||||||
new_height = int(height / scaler)
|
new_height = int(height / scaler)
|
||||||
pillow_img = pillow_img.resize((new_width, new_height))
|
pillow_img = pillow_img.resize((new_width, new_height))
|
||||||
|
|
||||||
width, height = pillow_img.size
|
width, height = pillow_img.size
|
||||||
|
if height > 2048:
|
||||||
if height > 1024:
|
scaler = ceil(height / 2048)
|
||||||
scaler = ceil(height / 1024)
|
|
||||||
new_width = int(width / scaler)
|
new_width = int(width / scaler)
|
||||||
new_height = int(height / scaler)
|
new_height = int(height / scaler)
|
||||||
pillow_img = pillow_img.resize((new_width, new_height))
|
pillow_img = pillow_img.resize((new_width, new_height))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue