-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working on cross origin #101
Comments
Using cors-anywhere worked for me. All you have to do is prepend the cors-anywhere URL to the URL of your image.
Then use that to pass to the Vibrant builder. Note that you can't use this cors URL if you're just trying to load it into an img src or background-image, etc -- you'll need to use the direct URL for that still. |
@SmartASCII while this might work for some instances, hammering |
Yes the proxy could work, but as a temporary workaround, I wouldn't use it
in production. At the end I'm uploading pics to my server and issue is
solved
…On Fri, Sep 20, 2019, 20:54 Corbin Crutchley ***@***.***> wrote:
@SmartASCII <https://github.com/SmartASCII> while this might work for
some instances, hammering cors-anywhere for larger scale projects would
not be ideal (nor would leaking data that way). I'd suggest allowing the
headers for any Vibrant request to be able to be modified added as a
feature to node-vibrant
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#101>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABCDSAYXIIX65U3I25N256LQKUL5TANCNFSM4ITLGRVQ>
.
|
Same issue, working on a way to fix it! |
Any idea on how to fix it? I'm using react-palette with images in S3 and from time to time I receive the CORS error. |
I used CORS-anywhere to ensure a solution like that would work and then rolled my own CORS proxy solution into my Node project so I could redirect locally -- been working fine for months now. |
Any updates regarding this? |
anyone trying to fix this? |
adding cors-anywhere not working in my angular 10 project. node-vibrant unable to load images from server due to cors-policy. |
This helped me with my APOD API project. Providing URL from the fetch response works when I use it on Simply prepending the link with |
What's odd is that it seems that there is code to handle this, but it just isn't working right: node-vibrant/src/image/browser.ts Lines 49 to 51 in 8843d00
|
Cors-anywhere no longer provides this functionality in a permanent fashion, and it was never meant to be used in production builds anyway. |
Does anyone have a solution to this issue? And I'm getting CORS error whenever I try using Vibrant to get colors from images. If you have any ideas except for using cors-anywhere I'm listening |
I found a workaround, you can directly pass an Image to vibrant, and set crossOrigin to anonymous: const img = new Image();
img.crossOrigin = 'Anonymous';
img.src = url; // + '?not-from-cache-please';
const v = new Vibrant(img, opts); You can add |
We're doing this, but unfortunately that's not solving the problem for us either. Still looking for a solution and will report back if I find one. Edit: Finally got it to work. It was indeed an image caching issue. And a frustrating one at that. I tried adding "?not-from-cache-please" to the end of my image urls and my code was not updating and I didn't realize it. Once I finally got it to update, adding that to the end of my images fixed the issue. |
I'm using vibrant in the browser and the images are on a different server than the one serving my app, actually they're Google Places photos. I tried in both loading a string or an but I always got a Cross-Origin error. My browser is Firefox.
I think cross origin images is a common scenario, how do you make it work?
Luca
The text was updated successfully, but these errors were encountered: