bchanudet / OctoPrint-Octorant

Discord plugin for OctoPrint
MIT License
26 stars 14 forks source link

Also allow Cura thumbnails #75

Closed BobSleeuw closed 11 months ago

BobSleeuw commented 11 months ago

Is it possible to also allow .ufp thumbnail files for gcode sliced in Cura? Other plugins like Slicer Thumbnails will show the Cura thumbnails, but that still doesn't make it possible to use them in this plugin.

bchanudet commented 11 months ago

Hello,

I'm not familiar with Cura's thumbnails. Are they generated aside the gcode or inside like PrusaSlicer?

Is there a way for you to send me a sample here on this issue? Many thanks :)

BobSleeuw commented 11 months ago

They are generated in the gcode, as commented lines at the start (I believe with base64 encoding). They are denoted at the start by ; thumbnail begin <width in px> <height in px> <variable I don't know> and end at ; thumbnail end.

Here is a sample .gcode file of a small cube (I changed the extension to .txt since github doesn't support .gcode)

5mmCube.txt

bchanudet commented 11 months ago

Thanks for the sample gcode!

That seems awfully close to the format I already handle for PrusaSlicer's thumbnails, I'll have a look at what's different between the two and check. :)

BobSleeuw commented 11 months ago

Awesome, thanks!

BobSleeuw commented 11 months ago

Works like a charm, awesome! Thanks for the quick fix @bchanudet!