Ensure QR codes have a border large enough for successful scan

(The QR code spec requires a border at least 4*box_size thick but we can't
 just set border=16 because that results in a QR code more than 255px tall
 and I'm not yet ready to use fullimage() as a backend for it)
This commit is contained in:
Stephan Sokolow 2014-05-22 01:41:02 -04:00
parent b6216403c4
commit 2a8f852c68
1 changed files with 3 additions and 0 deletions

View File

@ -152,7 +152,10 @@ class Escpos:
qr_img = qr_code.make_image() qr_img = qr_code.make_image()
# Convert the RGB image in printable image # Convert the RGB image in printable image
im = qr_img._img.convert("RGB") im = qr_img._img.convert("RGB")
self.text('\n')
self.set(align='center')
self.image(im) self.image(im)
self.text('\n')
def barcode(self, code, bc, height, width, pos, font): def barcode(self, code, bc, height, width, pos, font):
""" Print Barcode """ """ Print Barcode """