File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 11from __future__ import division
22import math
3+ import io
4+ import base64
35import numpy as np
46import usb .core
5- import itertools
67from functools import wraps
78from PIL import Image
89
@@ -268,6 +269,11 @@ def print_image_from_file(self, image_file):
268269 printable_image = PrintableImage .from_image (image )
269270 self .print_image (printable_image )
270271
272+ def print_image_from_buffer (self , data ):
273+ image = Image .open (io .BytesIO (base64 .b64decode (data )))
274+ printable_image = PrintableImage .from_image (image )
275+ self .print_image (printable_image )
276+
271277 @write_this
272278 def underline_on (self , weight = 1 ):
273279 """ Activate underline
Original file line number Diff line number Diff line change 22from setuptools import setup
33
44setup (name = "python_epson_printer" ,
5- version = "1.6 " ,
5+ version = "1.7 " ,
66 description = "A library to control Epson thermal printers based on ESC/POS language" ,
77 url = "https://github.com/benoitguigal/python-epson-printer" ,
88 author = "benoitguigal" ,
99 author_email = "benoit.guigal@gmail.com" ,
1010 packages = ['epson_printer' ],
1111 install_requires = [
1212 'pyusb==1.0.0b1' ,
13- 'Pillow==2.6' ,
14- 'numpy==1.9.2'
13+ 'Pillow==2.6'
1514 ])
You can’t perform that action at this time.
0 commit comments