Prusa-Firmware-Buddy icon indicating copy to clipboard operation
Prusa-Firmware-Buddy copied to clipboard

Increase the lines searched for PNG image

Open dunkmann00 opened this issue 10 months ago • 2 comments

Only effects plaintext gcode. The new QOI images make it necessary to look further into the gcode to find the PNG image for display in Prusalink (and maybe Prusaconnect? I've not used it so not sure).

Currently, if you have a plaintext gcode file with the default gcode thumbnails (for MK4 that means: 16x16/QOI, 313x173/QOI, 440x240/QOI, 480x240/QOI, 640x480/PNG) Prusalink can't load the thumbnail, because the printer fails to send it.

This fixes https://github.com/prusa3d/Prusa-Link-Web/issues/475

dunkmann00 avatar Apr 25 '24 20:04 dunkmann00

Thank you for the contribution. I looked into https://github.com/prusa3d/Prusa-Link-Web/issues/475 and tried your fix on the file they provided. It works for the large preview, but doesn't work for the small thumbnails.

The thing is, thumb/s/ API endpoint looks for images of exactly size 16x16 and type PNG and those are completely missing from the sliced file. While this fixes the issue with the large thumbnail, all the small thumbnails suffer penalty for searching the nonexistent thumbnail, as we are now searching twice the lines.

I would much rather ditch entire PNG support and let PrusaLink render the QOI files, perhaps using https://github.com/kchapelier/qoijs but that is a much larger change.

I am leaving this open and will discuss this more in the team.

danopernis avatar Apr 26 '24 12:04 danopernis

Okay, sounds good. I hadn't realized about the small thumbnails. Where are those shown on PrusaLink?

dunkmann00 avatar Apr 27 '24 00:04 dunkmann00