Aspect ratio for vertical images fixed

This commit is contained in:
José Carlos Cuevas 2020-09-09 20:57:00 +02:00
parent 10aabd57d9
commit 00a181ad76

View file

@ -41,7 +41,7 @@ def initialize():
printer_endpoint = config.get("PRINTER_ENDPOINT") or 0x01
# return Usb(prid1, prid2, printer_interface, printer_endpoint)
return File("/dev/usb/lp0")
return File("/dev/usb/lp2")
def reset_defaults(printer):
@ -199,7 +199,7 @@ def print_image(printer, image):
im = im.transpose(Image.ROTATE_90)
else:
height = math.floor(384.0 * ratio)
height = math.floor(384.0 / ratio)
im = im.resize((384, height))
im.save("temp.png")