KevinGong2013 / Printer

Swift ticket printer framework for ESC/POS-compatible thermal printers.
Apache License 2.0
147 stars 73 forks source link

Fatal error: Index out of range When convert Image to Data #23

Open mchan004 opened 4 years ago

mchan004 commented 4 years ago

I try to get Data from Ticket When convert Image to Data, it will Fatal error: Index out of range How to resolve it?

Screen Shot 2019-11-16 at 15 42 11
rikbauwens commented 4 years ago

It's a bug. But if you make sure the width of your image is dividable by 8 (e.g. 160), it'll work.

KevinGong2013 commented 1 year ago

Printer framework has been rewrite.

can you help testing qrcode&image command?

let receipt = Receipt(.🖨️58(.ascii))
<<~ .style(.initialize)
<<< QRCode(content: "https://g.cn")
<<< Image(cgImage)