switch default image format to bitImageRaster

Printers which don't have native QR rendering are less likely to support the newer GS ( L graphics command.
This commit is contained in:
Michael Billington 2016-04-06 21:39:46 +10:00
parent 6b445b3fb1
commit 4584e3138a
2 changed files with 5 additions and 5 deletions

View File

@ -49,7 +49,7 @@ class Escpos(object):
"""
pass
def image(self, img_source, high_density_vertical = True, high_density_horizontal = True, impl = "graphics"):
def image(self, img_source, high_density_vertical = True, high_density_horizontal = True, impl = "bitImageRaster"):
""" Print an image
:param img_source: PIL image or filename to load: `jpg`, `gif`, `png` or `bmp`

View File

@ -76,10 +76,10 @@ def test_image():
"""Test QR as image"""
instance = printer.Dummy()
instance.qr("1", native=False, size=1)
expected = b'\x1d(LO\x000p0\x01\x011\x17\x00\x17\x00\x00\x00\x00\x7f]\xfcA' \
b'\x19\x04]it]et]ItA=\x04\x7fU\xfc\x00\x0c\x00y~t4\x7f =\xa84j\xd9\xf0' \
b'\x05\xd4\x90\x00i(\x7f<\xa8A \xd8]\'\xc4]y\xf8]E\x80Ar\x94\x7fR@\x00\x00' \
b'\x00\x1d(L\x02\x0002'
print(instance.output)
expected = b'\x1dv0\x00\x03\x00\x17\x00\x00\x00\x00\x7f]\xfcA\x19\x04]it]et' \
b']ItA=\x04\x7fU\xfc\x00\x0c\x00y~t4\x7f =\xa84j\xd9\xf0\x05\xd4\x90\x00' \
b'i(\x7f<\xa8A \xd8]\'\xc4]y\xf8]E\x80Ar\x94\x7fR@\x00\x00\x00'
assert(instance.output == expected)
@raises(ValueError)