1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-09-13 09:09:58 +00:00

Merge remote-tracking branch 'faulab/fix-pc1252'

This commit is contained in:
Christoph Heuel
2015-12-12 16:43:27 +01:00
6 changed files with 25 additions and 67 deletions

View File

@@ -45,7 +45,7 @@ class Escpos:
buffer = ""
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(binascii.unhexlify(buffer))
buffer = ""
@@ -72,7 +72,7 @@ class Escpos:
if im.size[0] > 512:
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()
im_border = self._check_image_size(im.size[0])