Url from image item

Hi,

I run OH3 on a debian system and tried all night yesterday to get one of my image items as an image accessible by an url like http://OH3-server/static/image.jpg. But i could not figure it out.
The image is stored as an base64 string and I see no funcitonallity within OH3 to store this as an image file.
Can someone please help me with this?

BR
Daniel

One possibility to get an ImageItem extracted into a file would be using a shell script:

/usr/bin/curl -k -q -o - https://YourDomain/rest/items/YourImage/state | sed -e 's#data:image/png;base64,##' | base64 -d > /tmp/a.png

Remark: the sed part depends on the mime type. It can be changed to make it independent of the mime type of course.

1 Like

That worked like a charm! I love copy paste :slight_smile:
Thank you.
(Maybe this could be a future functionality to OH?)

1 Like