The Movie Database Support

This is the error i'm facing

Access to image at 'https://image.tmdb.org/t/p/w500/qx3m9mRUmDZUVQeAe7CAzFX7xCB.jpg' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I want image data as base64 so i'm just doing that using canvas

const img = new window.Image();
img.crossOrigin = "Anonymous";
img.onload = () => {
    const canvas = document.createElement("canvas");
    canvas.width = img.width;
    canvas.height = img.height;
    const ctx = canvas.getContext("2d");
    ctx.drawImage(img, 0, 0);
    const data = ctx.getImageData(0, 0, img.width, img.height); 
};
img.src = url;

1 reply (on page 1 of 1)

Jump to last post

@NayanVR said:
CORS error when working with canvas
This is the error i'm facing

Access to image at 'https://image.tmdb.org/t/p/w500/qx3m9mRUmDZUVQeAe7CAzFX7xCB.jpg' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I want image data as base64 so i'm just doing that using canvas

const img = new window.Image();
img.crossOrigin = "Anonymous";
img.onload = () => {
    const canvas = document.createElement("canvas");
    canvas.width = img.width;
    canvas.height = img.height;
    const ctx = canvas.getContext("2d");
    ctx.drawImage(img, 0, 0);
    const data = ctx.getImageData(0, 0, img.width, img.height); 
};
img.src = url;

CORS Issues
See if this research can help.
https://www.themoviedb.org/talk/search?advanced_search=&query=CORS&with_category=&with_status%5B%5D=closed&with_status%5B%5D=open
In some of the topics the problem was solved.
https://www.themoviedb.org/talk/5f55e3dd713ed40037f090d4
https://www.themoviedb.org/talk/5833110992514162cf03b7bd
https://www.themoviedb.org/talk/5c5dff05925141338cbce2db
https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSNotSupportingCredentials

And this
https://www.themoviedb.org/talk/5f621eae93388b003864513c
https://www.themoviedb.org/talk/5eb07271a13533001b72740a

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login