[FIX] hw_escpos: RBG images do not necessarily have an alpha channel

This commit is contained in:
Stefan Rijnhart 2016-03-24 10:23:04 +01:00 committed by Joren Van Onder
parent cb5d41da3b
commit 04765d4917
1 changed files with 1 additions and 1 deletions

View File

@ -445,7 +445,7 @@ class Escpos:
img_rgba = Image.open(f)
img = Image.new('RGB', img_rgba.size, (255,255,255))
channels = img_rgba.split()
if len(channels) > 1:
if len(channels) > 3:
# use alpha channel as mask
img.paste(img_rgba, mask=channels[3])
else: