escpos icon indicating copy to clipboard operation
escpos copied to clipboard

Printing images is extremely slow

Open pinpox opened this issue 3 years ago • 1 comments

Using an EPSON TM-T88II printer with this code snippet works (it prints the image) but is extremely slow. The printer prints one "line" of the image and waits for ~2 seconds, then prints the next line and so on. The printer is definitely capable of much faster printing, I'm also trying out the python-escpos library and that one spits out a complete image in under a second without any delay between lines.

Not sure what is happening here. The python library allows selecting between normal and "high density" mode when printing images, maybe that is the difference, but I don't see how to toggle it here.

	p := escpos.New(socket)
	p.SetConfig(escpos.ConfigEpsonTMT88II)

	f, err := os.Open("./logo.gif")
	if err != nil {
		panic(err)
	}
	defer f.Close()
	img, fmtName, err := image.Decode(f)

	if err != nil {
		panic(err)
	}

	p.PrintImage(img)

pinpox avatar Mar 03 '22 13:03 pinpox

I have not that much experience with serial connection optimization. I guess there might be some bottleneck with buffers or so.

hennedo avatar Sep 27 '22 12:09 hennedo