Open pjvenda opened 5 months ago
gcode file with thumbnail not rendering attached for reference
The generated thumbnails that don't render on PrusaLink do render on the printer's screen.
I'm seeing this same problem as well.
I have experienced that .bgcode is not affected.
I was just playing around with it myself, and if you move the PNG thumbnail from the last one in the list to the first, the image loads correctly in PrusaLink.
So when I change G-code thumbnails
from this:
16x16/QOI, 313x173/QOI, 440x240/QOI, 480x240/QOI, 640x480/PNG
(which is the PS default for my MK4)
to this:
640x480/PNG, 16x16/QOI, 313x173/QOI, 440x240/QOI, 480x240/QOI
the image loads.
I think the problem is actually in Prusa-Firmware-Buddy
, since its the printer that is returning nothing to the PrusaLink client.
Digging through the code, the problem starts here:
And then AFAICT depending on if you have a binary g-code or a regular g-code file a different code path is followed (PlainGcodeReader::stream_thumbnail_start
or PrusaPackGcodeReader::stream_thumbnail_start
). This would be why the behavior is different depending which format is used.
As to why it works when moving the PNG thumbnail to the front of the list; it looks like there is a limit to the number of lines searched for a PNG thumbnail here:
So I guess someone will need to determine what they feel is the best way to evaluate the regular g-code for thumbnails. If the Prusa devs are okay with just increasing MAX_SEARCH_LINES
I'd be happy to submit a PR for that.
Description of the bug
I am using PrusaSlicer 2.7.1 on the default mk4/IS printer profile and I am finding the thumbnails for the slices I generate are not being interpreted. By PrusaLink. I cannot be sure it was rendered on the printer's screen, I'll have to check on the next print. (PrusaConnect can parse the thumbnail correctly).
This is a single colour print, using the 'Generic PETG' profile output to a text gcode file.
I had a look through the gcode and compared a couple of files, one with thumbnails that render and one with thumbnails that do not render. The similarities are that thumbnails exist on both files. The differences are that the ones that work were generated by PrusaSlicer 2.7.0 and have one less tn format:
PrusaSlicer 2.7.0 - thumbnails render correctly:
PrusaSlicer 2.7.1 - thumbnails not rendering
Notice the latter has 5 thumbnail images in different resolutions, whereas the former (the one that works) has 4 - it is missing 480x240/QOI. But this does not appear to be the problem, because I removed this thumbnail from the gcode, changed the
thumbnails =
line and re-uploaded to PrusaLink; It still does not render.Project file & How to reproduce
Checklist of files included above
Version of PrusaSlicer
2.7.1+linux-x64-GTK3-202312121425
Operating system
Linux Debian 12
Printer model
Prusa mk4 IS