Hi, i am using fast-average-color repo to get average color of movie poster but it gives me an error and it says "security error (CORS) for resource https://image.tmdb.org/t/p/w500/wlfDxbGEsW58vGhFljKkcR5IxDj.jpg". How should i solve this problem?
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by ticao2 π§π· pt-BR
on May 4, 2020 at 7:28 PM
It may be best to seek assistance from the program.
https://github.com/fast-average-color/fast-average-color
Anyway, if the problem is security, you better inform more:
What is your OS?
In wich country are you?
We know that the Android OS eventually has security protocol problems due to the system update.
Does this problem occur only with this image, or any TMDb poster?
EDIT
The program has 3 ways to get the job done.
Which one are you using?
Reply by Biostate56
on May 4, 2020 at 7:39 PM
Sorry, this problem occurs on every image. I am from Turkey. I am using vue cli. Library just needs a URL, i gave the poster url to function but i got this error. Images are fine when i use as a img source like showing the poster on front end but i am getting this error when i give poster url to library function to get average color. Also I donβt have any problem to show or open on my browser. The problem only occurs when i use the library.
Edit: i tried loaded and image url options.
Reply by ticao2 π§π· pt-BR
on May 4, 2020 at 7:44 PM
I believe that only Travis Bell, TMDb administrator, can help.
Let's wait for him to see your question.
Reply by Biostate56
on May 5, 2020 at 3:40 PM
Can i send message this admin?
Reply by ticao2 π§π· pt-BR
on May 5, 2020 at 8:02 PM
I'll try to warn him.
He's been very busy.
Just see the To-Do list on Trello https://trello.com/b/k34aFUme/web
In the meantime, try a search here on the Forum for CORS.
I found several comments from Travis.
Maybe it will help.
https://www.themoviedb.org/talk/search?advanced_search=&query=CORS&with_category=&with_status%5B%5D=closed&with_status%5B%5D=open
Reply by Biostate56
on May 5, 2020 at 8:08 PM
Yeah, i looked before post this topic. But there is no solution for images. They get CORS error for getting movie data etc. and Travis Bell is hardworking guy i see. I am searching for another library. Maybe library is the broken.
Reply by Biostate56
on May 5, 2020 at 8:41 PM
I solved it with this article. I tried it before but it didn't help me. Now it's works. Steps:
1) Add this to your vue.config.js
2) Change image url
link to
Example:
to
Reply by ticao2 π§π· pt-BR
on May 5, 2020 at 11:29 PM
Great
Reply by phamquy481
on December 18, 2022 at 3:29 AM
Hi Biostate56, Im using fast-average-color lib and and getting same issue. Do you have any solution for React JS. Many thanks,
Reply by kevinlenske
on February 11, 2023 at 4:56 PM
This is so stupid, I run into the same problem and then thinking I've finally found a solution only to see that your solution is in Vue!! π€¬
Reply by kevinlenske
on February 11, 2023 at 6:41 PM
Okay I found the solution for React! It was so simple lmao
Reply by ticao2 π§π· pt-BR
on February 11, 2023 at 9:10 PM
Would it be possible for you to share with other React users the solution you found?
Reply by kevinlenske
on February 11, 2023 at 9:23 PM
No, because it was a false alarm. My only option right now is to proxy my requests in the backend...
Reply by phamquy481
on February 12, 2023 at 3:27 AM
I solved this problem by change the image url to (https://image.tmdb.org/t/p/w220_and_h330_face/...). And for some reason it works fine.
Reply by kevinlenske
on February 12, 2023 at 10:30 AM
Pham thank you so much!! I spent an ENTIRE day torturing myself trying to figure this out. You are a blessing to the world my man. And it's so odd that you have to change it to those specific URL. Very weird. Thanks a million π.