natcl / node-red-contrib-streamdeck

A Node-RED node to interact with the Elgato Stream Deck products
Apache License 2.0
13 stars 4 forks source link

svg support #18

Closed la9vka closed 2 years ago

la9vka commented 2 years ago

Is there a way to send svg directly to out node?

I have everything else working, but if I try to send a svg (converted to buffer) I get "Error: Could not find MIME for Buffer " Regardless of having the mime added at the start as you need when sending using a desktop plugin.

As I stream lots of svg data I'd prefer not having to convert everything to images.

natcl commented 2 years ago

The stream deck doesn't support svg sadly. You would need to find a way to convert the SVGs to a raster image format before sending it to the stream deck.

natcl commented 2 years ago

I suggest you have a look at https://techsparx.com/nodejs/graphics/svg-to-png.html Which could allow you to convert an svg to png in a function node in Node-RED.

la9vka commented 2 years ago

Thanks for the answer. Looks like the windows application does the conversion then. All the methods I have found is too resource intensive when converting 1-3fps on several buttons running on a raspi. node-red-contrib-image-tools works nice with your node, so I'll rewrite using that. Good work making the node :)