-
Notifications
You must be signed in to change notification settings - Fork 27
Easy way to publish SVG images #1
Comments
Bart, brainstorming here without thinking of the memory footprint just yet. Could you define an endpoint on Node-RED where (temporary) images are made available, or even converted from a base64 incoming message? Then that URL to be put in the image source. |
Is Inkscape something you would consider easy? This is how some of the other home automation groups generate SVGs. Or were you trying to keep it local with a web interface? |
Hi @QuagmireMan, Thanks for your feedback! But could it be that your feedback is more related to this issue? I will answer you there, to keep things separated... |
@Steve-Mcl ,
About the latter option:
But not sure how this works:
|
When the user adds a local image using the DrawSVG online editor: Then we see that this image also has been inserted by DrawSVG into the SVG as base64 string:
From this I conclude that we should do something similar: When a local file is being added manually to the SVG source Remark: when returning back from the external SVG editor, the original local path should be restored somehow (since we don't want to store the base64 string into Node-RED's flow.json file). |
Hi Bart, this is certainly possible (can easily temporarily store the path in a custom attribute) however when the SVG is served in dashboard, the image file:// may not be accessible in the browser (certainly not on a remote browser) Options I can think of are (ranked from easiest to hardest)...
Hopefully this feedback gives you a 💡 moment |
Hey Steve, I think the following situations are possible: 1 - Online image
Caution: if the dashboard has no internet access, the image cannot be displayed. So we could convert the hyperlink to a base64 string, before sending the SVG to the dashboard. But of course that is only possible when the Node-RED flow can access the internet ... Don't think there is a waterproof solution and it is best to put on the readme page that local images should be used in these kind of situations. 2 - Link to local image
This can be solved by doing it another way:
3 - Included local image
4 - User overwrites a local image (Special case)
We will only need an endpoint to get the base64 string of a specified local image file ... |
When using an SVG 'image' element, a source image needs to be specified.
For example:
Would like to have an easy way to make local images available. But how?
And should it be possible to push the images (as a base64 string) via an input message?
The text was updated successfully, but these errors were encountered: