vcync / modV

modular audio visualisation powered by JavaScript
https://modv.vcync.gl
MIT License
448 stars 25 forks source link

SVG support #466

Open TimPietrusky opened 3 years ago

TimPietrusky commented 3 years ago

Is your feature request related to a problem? Please describe. Provide support for SVG.

Describe the solution you'd like What could be done already is to update src/media-manager/read-handlers/image.js and add svg to the array, but then when loading the svg I see this error: Uncaught (in promise) Error: The source image could not be decoded.

Describe alternatives you've considered Converting the image to PNG.

2xAA commented 3 years ago

OffscreenCanvas doesn't support drawing SVGs as there is no DOM to read the SVG data and convert to a usable format.

We could use the MediaManager to convert the SVG to an image, as we convert GIFs to video?

TimPietrusky commented 2 years ago

We could also take a look at https://github.com/canvg/canvg

2xAA commented 2 years ago

@TimPietrusky looks like a good option! I'd be in favour of real time conversion/holding in memory to avoid stale assets on disk.