From fa71c39780f1fa952eb93a2cd828cbdf073e2041 Mon Sep 17 00:00:00 2001 From: zman Date: Tue, 8 Apr 2025 11:55:30 -0400 Subject: [PATCH] h --- app.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app.py b/app.py index 3a472be..d12baab 100644 --- a/app.py +++ b/app.py @@ -57,18 +57,18 @@ def convert_pdf_to_images(pdf_path): # Function to print address labels def print_address_label(images, pdf_path): try: - - 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) + for image in images: + 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