From 7d4ef744de5e74cdf4d765aa3ba74120030be600 Mon Sep 17 00:00:00 2001 From: Thomas van den Berg Date: Wed, 27 Feb 2013 23:18:49 +0100 Subject: [PATCH] fix band printing --- escpos/escpos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/escpos/escpos.py b/escpos/escpos.py index 512a99e..906c985 100644 --- a/escpos/escpos.py +++ b/escpos/escpos.py @@ -85,7 +85,7 @@ class Escpos: bandsize = 255 current = 0 while current < im.size[1]: - self.image(im.crop((0, current, width, current + bandsize))) + self.image(im.crop((0, current, width, min(im.size[1], current + bandsize)))) current += bandsize