Allow bandsize to be varied in fullimage()

This commit is contained in:
Stephan Sokolow 2014-08-15 20:17:35 -04:00 committed by Patrick Kanzler
parent a6ec674828
commit 0e907644d9
1 changed files with 1 additions and 2 deletions

View File

@ -163,7 +163,7 @@ class Escpos(object):
# Convert the RGB image in printable image # Convert the RGB image in printable image
self._convert_image(im) self._convert_image(im)
def fullimage(self, img, max_height=860, width=512, histeq=True): def fullimage(self, img, max_height=860, width=512, histeq=True, bandsize=255):
""" Resizes and prints an arbitrarily sized image """ """ Resizes and prints an arbitrarily sized image """
if isinstance(img, (Image, Image.Image)): if isinstance(img, (Image, Image.Image)):
im = img.convert("RGB") im = img.convert("RGB")
@ -195,7 +195,6 @@ class Escpos(object):
im = im.crop((0, 0, im.size[0], max_height)) im = im.crop((0, 0, im.size[0], max_height))
# Divide into bands # Divide into bands
bandsize = 255
current = 0 current = 0
while current < im.size[1]: while current < im.size[1]:
self.image(im.crop((0, current, width or im.size[0], self.image(im.crop((0, current, width or im.size[0],