asdf
This commit is contained in:
parent
357e47cc73
commit
fe07e61505
15
app.py
15
app.py
@ -55,10 +55,17 @@ def print_address_label(pdf_path):
|
|||||||
if not image:
|
if not image:
|
||||||
raise Exception("Failed to create label images")
|
raise Exception("Failed to create label images")
|
||||||
|
|
||||||
target_width = 1164
|
if 'address' in pdf_path.lower():
|
||||||
target_height = 1660
|
target_width = 1660
|
||||||
image = image.convert("RGB")
|
target_height = 1164
|
||||||
image = image.resize((target_width, target_height), Image.LANCZOS)
|
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 = BrotherQLRaster(printer_model)
|
||||||
qlr.exception_on_warning = True
|
qlr.exception_on_warning = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user