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:
parent
6b445b3fb1
commit
4584e3138a
|
@ -49,7 +49,7 @@ class Escpos(object):
|
||||||
"""
|
"""
|
||||||
pass
|
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
|
""" Print an image
|
||||||
|
|
||||||
:param img_source: PIL image or filename to load: `jpg`, `gif`, `png` or `bmp`
|
:param img_source: PIL image or filename to load: `jpg`, `gif`, `png` or `bmp`
|
||||||
|
|
|
@ -76,10 +76,10 @@ def test_image():
|
||||||
"""Test QR as image"""
|
"""Test QR as image"""
|
||||||
instance = printer.Dummy()
|
instance = printer.Dummy()
|
||||||
instance.qr("1", native=False, size=1)
|
instance.qr("1", native=False, size=1)
|
||||||
expected = b'\x1d(LO\x000p0\x01\x011\x17\x00\x17\x00\x00\x00\x00\x7f]\xfcA' \
|
print(instance.output)
|
||||||
b'\x19\x04]it]et]ItA=\x04\x7fU\xfc\x00\x0c\x00y~t4\x7f =\xa84j\xd9\xf0' \
|
expected = b'\x1dv0\x00\x03\x00\x17\x00\x00\x00\x00\x7f]\xfcA\x19\x04]it]et' \
|
||||||
b'\x05\xd4\x90\x00i(\x7f<\xa8A \xd8]\'\xc4]y\xf8]E\x80Ar\x94\x7fR@\x00\x00' \
|
b']ItA=\x04\x7fU\xfc\x00\x0c\x00y~t4\x7f =\xa84j\xd9\xf0\x05\xd4\x90\x00' \
|
||||||
b'\x00\x1d(L\x02\x0002'
|
b'i(\x7f<\xa8A \xd8]\'\xc4]y\xf8]E\x80Ar\x94\x7fR@\x00\x00\x00'
|
||||||
assert(instance.output == expected)
|
assert(instance.output == expected)
|
||||||
|
|
||||||
@raises(ValueError)
|
@raises(ValueError)
|
||||||
|
|
Loading…
Reference in New Issue