1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-09-13 09:09:58 +00:00

normalize whitespace

This commit is contained in:
Patrick Kanzler
2017-01-30 01:50:27 +01:00
parent ca880dd8ec
commit ce94a1fc18
4 changed files with 16 additions and 16 deletions

View File

@@ -28,7 +28,7 @@ class EscposImage(object):
def __init__(self, img_source):
"""
Load in an image
:param img_source: PIL.Image, or filename to load one from.
"""
if isinstance(img_source, Image.Image):
@@ -45,12 +45,12 @@ class EscposImage(object):
im = Image.new("RGB", img_original.size, (255, 255, 255))
im.paste(img_original, mask=img_original.split()[3])
# Convert down to greyscale
im = im.convert("L")
im = im.convert("L")
# Invert: Only works on 'L' images
im = ImageOps.invert(im)
# Pure black and white
self._im = im.convert("1")
@property
def width(self):
"""