Yesterday I got a question about embedded images with my node-red-contrib-ui-web-push node. In this link you can see that it is possible to embed an image into a web push notification. For example when your camera capture an image of a burglar, you can send that image to your Android smartphone inside the notification:
However you need to include an image URI in the notification, which has some disadvantages:
You probably don't want the image to be public accessible to everybody on the internet.
The image should only be temporary available on the internet (until the client has read it). But you don't know how long ...
Luckily the web push notification documentation shows that the image url can be a data URI:
A data URI means that the resource (in this case the camera snapshot image) will be base64 encoded and included inside the URL. As a result the resource can be kept private, and can be removed after we have pushed it to our clients (e.g. Android smartphone).
As always all "constructive" feedback is very welcome !!
P.S. It is not available on NPM yet, so if you want to test it you can install it directly from my Github repository (from within your .node-red folder):
Don't know if it can help, but I had already added both "URL" and "URI" to the list of keywords. Hopefully that helps people to find their way to this node ...
A very helpful node Bart. I can envisage uses for this in all sorts of places.
For example, I use a data URI in my professional email signatures (for the BCS logo for example, sometimes for some corporate messages). Those will be displayed by email clients where external image links will not be (due to security issues).
Hi Bart, sorry, honestly dont mean to rain on your parade but I just wanted to point out that if anyone has already installed node-red-contrib-image-tools and are using it for resizing / rotating an image etc before posting to Telegram or Notification etc, that it was already possible to generate a data URI of an image...
... the idea of including that feature in image-tools was exactly for this scenario where you would be working with images then would like to transmit it somewhere like Telegram or Email etc.
Obviously, this is limited to images unlike your node.
Hi Steve,
Thanks for the tip!
Indeed the use case that I have described above, this might indeed be a good solution.
I have added an Alternatives section to my readme page, to mention this.