Support for images vertically longer than 256 pixels
This commit is contained in:
parent
5eaa6f26d0
commit
3f6528da07
|
@ -41,7 +41,7 @@ class Escpos:
|
||||||
buffer = ""
|
buffer = ""
|
||||||
|
|
||||||
self._raw(S_RASTER_N)
|
self._raw(S_RASTER_N)
|
||||||
buffer = "%02X%02X%02X%02X" % (((size[0]/size[1])/8), 0, size[1], 0)
|
buffer = "%02X%02X%02X%02X" % (((size[0]/size[1])/8), 0, size[1]&0xff, size[1]>>8)
|
||||||
self._raw(buffer.decode('hex'))
|
self._raw(buffer.decode('hex'))
|
||||||
buffer = ""
|
buffer = ""
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ class Escpos:
|
||||||
|
|
||||||
if im.size[0] > 512:
|
if im.size[0] > 512:
|
||||||
print ("WARNING: Image is wider than 512 and could be truncated at print time ")
|
print ("WARNING: Image is wider than 512 and could be truncated at print time ")
|
||||||
if im.size[1] > 255:
|
if im.size[1] > 0xffff:
|
||||||
raise ImageSizeError()
|
raise ImageSizeError()
|
||||||
|
|
||||||
im_border = self._check_image_size(im.size[0])
|
im_border = self._check_image_size(im.size[0])
|
||||||
|
|
Loading…
Reference in New Issue