Garbage after printing an image with a height a multiple of 96 pixels.
Bug description
Similar to #367. Printing an image with a height a multiple of 96 (96, 192, 288, etc) the first time is successful. Subsequent text() calls are ignored, including text('\n'). Sending another image results in printing a small section of the image, shifted to the right, followed by garbage.
Steps to reproduce
-
p = escpos.printer.Usb(*settings) -
p.image('some-image-height-96-pixels.png') -
p.text('this is ignored\n') -
p.image('any-other-image.png') - Garbage comes out of the printer at this point
Device info
Printer: POS-5890K (this one)
python-escpos version: 2.2.0
python version: 3.8.5
operating system: Arch Linux
Hi, is there any difference to #367? If not, we can close this issue, and see in #367 how to proceed.
Was the same problem with exactly XPrinter 48mm POS-5890K. During debugging the issue we experimentally figured out that it started printing gibberish when we send command GS v 0 with image height multiple of 48 only : i.e. 240, 192, 144, 96 . We handled this case with spliting whole image into chunks of multiple of 256 and then if smaller chunk is multiple of 48 then increase image height on 8 and just fill that addition with 255 brightness pixels. Finally send chunks of GS v 0 one by one to the printer. The issue was with GO escpos library. So it seems a bug with printer`s firmware