Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.

Commit b8bdca0

Browse files
Merge pull request #39 from zackdotcomputer/fix/thermal-driver
Fix printImage crashing if given Image not path
2 parents 8107630 + 6f26289 commit b8bdca0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Adafruit_Thermal.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,11 @@ def printBitmap(self, w, h, bitmap, LaaT=False):
549549
# passing the result to this function.
550550
def printImage(self, image_file, LaaT=False):
551551
from PIL import Image
552-
image = Image.open(image_file)
552+
image = image_file
553+
554+
if isinstance(image_file, str):
555+
image = Image.open(image_file)
556+
553557
if image.mode != '1':
554558
image = image.convert('1')
555559

0 commit comments

Comments
 (0)