Skip to content

Commit

Permalink
Ensure QR codes have a border large enough for successful scan
Browse files Browse the repository at this point in the history
(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)
  • Loading branch information
Stephan Sokolow authored and Stephan Sokolow committed May 22, 2014
1 parent b621640 commit 2a8f852
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions escpos/escpos.py
Expand Up @@ -152,7 +152,10 @@ def qr(self, text):
qr_img = qr_code.make_image()
# Convert the RGB image in printable image
im = qr_img._img.convert("RGB")
self.text('\n')
self.set(align='center')
self.image(im)
self.text('\n')

def barcode(self, code, bc, height, width, pos, font):
""" Print Barcode """
Expand Down

0 comments on commit 2a8f852

Please sign in to comment.