I am having a API connected and throwing requests with no cors headers to frontend and image URL's are extracted and sent to vibrant.in that case the image is not extracted into the vibrant, and throws an error
No 'Access-Control-Allow-Origin' header is present on the requested resource.
any preferred way to overcome this?
Run the image through a CORS proxy a la https://cors.now.sh.
@TooTallNate Confirmed this works for me. Thanks!
That said, this feels like a hack. Any ideas for solving this issue within node-vibrant
itself?
Something new here?
Fuck this is killing me. Its weird cause if you use the constructor method it works fine, but if you use the promise method it complains about CORS. My guess is the promise method takes the url and directly loads it into Canvas, which is a big no-no for Chrome. No other browsers give a shit. So if you use the new image constructor to load the image into ram, and then pass that into the Canvas it ought to be fine. I haven't taken a look at the source code but I'm pretty sure that's it.
Most helpful comment
Run the image through a CORS proxy a la https://cors.now.sh.