asdf
This commit is contained in:
parent
357e47cc73
commit
fe07e61505
17
app.py
17
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user