From fe07e615051b2ffb09268b386c44b4b76b3180b4 Mon Sep 17 00:00:00 2001 From: zman Date: Mon, 7 Apr 2025 17:49:19 -0400 Subject: [PATCH] asdf --- app.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index ab6f804..26009d1 100644 --- a/app.py +++ b/app.py @@ -54,11 +54,18 @@ def print_address_label(pdf_path): image = convert_pdf_to_image(pdf_path) if not image: raise Exception("Failed to create label images") - - target_width = 1164 - target_height = 1660 - image = image.convert("RGB") - image = image.resize((target_width, target_height), Image.LANCZOS) + + if 'address' in pdf_path.lower(): + target_width = 1660 + target_height = 1164 + image = image.convert("RGB") + image = image.resize((target_width, target_height), Image.LANCZOS) + image = image.rotate(90, expand=True) + else: + target_width = 1164 + target_height = 1660 + image = image.convert("RGB") + image = image.resize((target_width, target_height), Image.LANCZOS) qlr = BrotherQLRaster(printer_model) qlr.exception_on_warning = True