fraschetti/Octoslack

[feature request] thunbnail from gcode

JFSolution opened this issue · 2 comments

Include thumbnail from gcode in print started message

Here is how to include a thumbnail in gcode:
https://plugins.octoprint.org/plugins/prusaslicerthumbnails/

@fraschetti Both the PrusaSlicerThumbnails plugin and the UltimakerFormatPackage plugin utilize the same approach for thumbnails. They both add thumbnail and thumbnail_src metadata properties to the files, which is returned by the file API, and also accessible via self._file_manager.get_metadata("local", <file_path>) calls in Python if I'm not mistaken.

In both cases the URL is a relative URL to the png image.

@fraschetti I think if you can store a second variable with the file name, without the '.gcode' at the end, this would work as a quick fix.

Ultimaker Preview Url:
http://<IP_ADDRESS>/plugin/UltimakerFormatPackage/thumbnail/<FILE_NAME>.png

I think your {print_name} variable contains the file extenstion.

If this were changed, i would could replace <FILE_NAME> in the url with your stored variable.

here is an example when i manually enter the URL:
image