rikukissa / node-red-contrib-image-output

🏞 Easy way of previewing and examining images in your flows
MIT License
13 stars 6 forks source link

Static images support #7

Closed bartbutenaers closed 4 years ago

bartbutenaers commented 6 years ago

Hi Riku (@rikukissa),

To display some 'no image available' image, I started to draw it using SVG (as we agreed upon). However it became very fast a messy complex setup:

So I went back to the static image solution. If you don't like it, you can write some SVG code. But I'm running out of time at the moment ... The advantage is that the html file doesn't have to be updated, since the client code doesn't need to be aware about the content of the images.

The mechanism works like this:

P.S. I have also changed (in the html file) the mouse cursor. When hoovering above the image, it showed a 'move' cursor: image This was inherited from the nodegroup: image But that is a bit silly: the node itself can be moved, but not the image ... So I changed it to the default Node-Red splithair cursor. Now the default cursor doesn't change when hoovering above the image. Please restore the 'move' cursor if you don't like my explanation...

Looking forward to your feedback!! Bart

bartbutenaers commented 6 years ago

P.S. Normally I show errors in the node status (with a red ring). However then the node status is located on the same position as our arrow, which doesn't look. Therefore I have added an extra incorrect_input.png, so I display the node status inside the image ...

bartbutenaers commented 6 years ago

@rikukissa,

I just discovered an issue with this pull request.

The images (e.g. 'no image available') are displayed correctly in the Node-Red flow. However when I refresh my browser window, those images disappear. Seems that the 'latestImages' list is empty after the refresh, and as a result the 'render' function is not called:

image

Moreover the function ImageNode on the server side is also not called, when the browser window is refreshed. As a result, the images are also not resend to the browser.

Do you have perhaps any suggestion how we could solve this?

Thanks !!!