jneilliii / OctoPrint-PrusaSlicerThumbnails

91 stars 20 forks source link

Enable parsing of JPG format by Prusa Slicer #97

Closed Den41k92 closed 1 year ago

Den41k92 commented 1 year ago

This small change extends regex filter to also match "thumbnail_JPG" header produced by PrusaSlicer, if an option of thumbnail format is set to JPG.

image

The GCODE section for this format looks like this (note the added _JPG suffix):

; thumbnail_JPG begin 256x256 39920
; --- image data ---
; thumbnail_JPG end

Tested this PR works both with PNG and JPG options on PrusaSlicer 2.5.0

Den41k92 commented 1 year ago

Curious what the benefit is of the new format?

There isn't really a significant one, JPG only saves a few KB on large sized thumbnails. The scope was to extend the compatibility, since all my gcode files were saved with this option.