Trying to grab an image from octoprint.
I have all the needed into it seems I need to combine the path
Help from the octoprint discord pointed me at this.
val imageUrl = "http://octopi:8080".toHttpUrl().newBuilder(file.thumbnail).build()
Tried a few things for the last hour or 2
I have all the needed info from the REST API call just cannot figure out how to combine them to a usable URL.
Anyway, just wonder if anyone could point me in a direction.
** FYI: I live in a city that is... Well the Internet is spotty at best (if it works at all) but that's another story for another place.
Forgive me if it takes a while for me to reply. **
LOL, I have the REST docs on standby, have them even offline as I have MAJOR internet issues.
The file operation have nothing to do with retrieving thumbnails. Just URI info.
I don´t know Octoprint at all.
As it is a software i thought the software implements a http-Server which you can use in your network (even with no internet). The rest-docs are always using example.com as address. This can probably be your IP in local network running the Octoprint-Software?
Find the documentation which describes retrieving thumbnails.
So in my REST reply --- file.thumbnail is:
"plugin/prusaslicerthumbnails/thumbnail/Cooler_Master_HDD_Rails_v4TN.png?20220619044740"
Lots of JAVA help there on Discord, no B4J help... Most are using the the Picasa JAVA lib for rendering.
@DonManfred Octoprint is a local server running on a RasPi. The REST docs are pretty good, I have seen worse.
There is no direct example as thumbnails are an add-in provided by the 3d printer slicer software. So you slice a model and sent it to Octoprint.
Seems the Octo REST API just shares the info it has.
Got it figured all.
Just add "http://192.168.1.212:5005" and file.thumbnail var returned from Octoprint.
Just made sure it was all was clean and properly formatted.
The ".toHttpUrl().newBuilder(file.thumbnail).build()" JAVA code just threw me for a loop. Thought there was something special to be done.