Skip to content
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

Image not loading using URL as src #4563

Closed
harshnagar opened this issue Dec 13, 2024 · 4 comments
Closed

Image not loading using URL as src #4563

harshnagar opened this issue Dec 13, 2024 · 4 comments

Comments

@harshnagar
Copy link

Hello, I am trying to add Image in my Image Control but its not loading when provided URL to the Image although the image is accessible when opening in browser.

ft.Image(
                src=f"https://i.ytimg.com/vi_webp/fWVtPYZxRXE/maxresdefault.webp",
                height=200,
                fit=ft.ImageFit.NONE,
                repeat=ft.ImageRepeat.NO_REPEAT,
                border_radius=ft.border_radius.all(10)
)
@ndonkoHenri
Copy link
Contributor

I get this when i run you code:
image

@ndonkoHenri
Copy link
Contributor

ndonkoHenri commented Dec 14, 2024

Just from trying it on web, and i get CORS error, which prevents the image from being displayed:
image

Is that what you get? (Open the console tab of the browser)

@harshnagar
Copy link
Author

Just from trying it on web, and i get CORS error, which prevents the image from being displayed:

image

Is that what you get? (Open the console tab of the browser)

Yes getting the same error on web, is there any way to get ride out of this in order to display this image on web.

@ndonkoHenri
Copy link
Contributor

CORS happens independent of Flet.

You can read online on how you could go about that:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants