The Movie Database 支持

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?

16 回复(第 1 页,共 2 页)

Jump to last post

下一页末页

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?

  • Get average color from loaded image
  • Get average color from unloaded image
  • Get average color from image url

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.

I believe that only Travis Bell, TMDb administrator, can help.
Let's wait for him to see your question.

Can i send message this admin?

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

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.

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

module.exports = {devServer: {
    proxy: 'http://image.tmdb.org/',
    }
  };

2) Change image url

'http://image.tmdb.org/'

link to

'http://localhost:8080'

Example:

http://image.tmdb.org/t/p/w500/8WUVHemHFH2ZIP6NWkwlHWsyrEL.jpg

to

http://localhost:8080/t/p/w500/8WUVHemHFH2ZIP6NWkwlHWsyrEL.jpg

Great sunny

Hi Biostate56, Im using fast-average-color lib and and getting same issue. Do you have any solution for React JS. Many thanks,

@Biostate56 said:

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

module.exports = {devServer: {
    proxy: 'http://image.tmdb.org/',
    }
  };

2) Change image url

'http://image.tmdb.org/'

link to

'http://localhost:8080'

Example:

http://image.tmdb.org/t/p/w500/8WUVHemHFH2ZIP6NWkwlHWsyrEL.jpg

to

http://localhost:8080/t/p/w500/8WUVHemHFH2ZIP6NWkwlHWsyrEL.jpg

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!! 🤬

Okay I found the solution for React! It was so simple lmao

@kevinlenske said:
Okay I found the solution for React! It was so simple lmao

Would it be possible for you to share with other React users the solution you found?

@ticao2 said:

@kevinlenske said:
Okay I found the solution for React! It was so simple lmao

Would it be possible for you to share with other React users the solution you found?

No, because it was a false alarm. My only option right now is to proxy my requests in the backend...

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.

@phamquy481 said:

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.

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 🙏.

找不到电影或剧集?登录并创建它吧。

全站通用

s 聚焦到搜索栏
p 打开个人资料菜单
esc 关闭打开的窗口
? 打开键盘快捷键窗口

在媒体页面

b 返回(或返回上级)
e 进入编辑页面

在电视季页面

(右箭头)下一季
(左箭头)前一季

在电视集页面

(右箭头)下一集
(左箭头)前一集

在所有图像页面

a 打开添加图片窗口

在所有编辑页面

t 打开翻译选择器
ctrl+ s 提交

在讨论页面

n 创建新讨论
w 切换关注状态
p 设为公开 / 私密讨论
c 关闭 / 开放讨论
a 打开活动页
r 回复讨论
l 跳转至最新回复
ctrl+ enter 发送信息
(右箭头)下一页
(左箭头)前一页

设置

想给这个条目评分或将其添加到片单中?

登录

还不是会员?

注册加入社区