Node-vibrant: not accepting image url's without CORS headers

Created on 15 Jun 2017  ·  4Comments  ·  Source: Vibrant-Colors/node-vibrant

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?

Most helpful comment

Run the image through a CORS proxy a la https://cors.now.sh.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stelasido picture stelasido  ·  15Comments

amirping picture amirping  ·  6Comments

chetstone picture chetstone  ·  14Comments

glomotion picture glomotion  ·  5Comments

nitriques picture nitriques  ·  12Comments