flet-dev / flet

Flet enables developers to easily build realtime web, mobile and desktop apps in Python. No frontend experience required.
https://flet.dev
Apache License 2.0
11.5k stars 449 forks source link

Image not reload by clear control and add as new control refered to same path, but difrent image #4275

Closed Rzezimioszek closed 2 weeks ago

Rzezimioszek commented 3 weeks ago

Duplicate Check

Describe the bug

If i have control with image and change image, clear control and make new one with same name and same path, but with new picture i still get old picture. Only way to escape it is to add image as src_base64, but it add aditional work to someting that's supost to work out of box. If i have image from example url https://picsum.photos/200/200?1 what i need to do to get new image without saving image , converting to base64 etc.?

img = ft.Image(
        src=f"/icons/icon-512.png",
        width=100,
        height=100,
        fit=ft.ImageFit.CONTAIN,
    )

Code sample

Code ```python [Paste your code here] ```

To reproduce

img = ft.Image( src=f"/icons/icon-512.png", width=100, height=100, fit=ft.ImageFit.CONTAIN, )

Expected behavior

No response

Screenshots / Videos

Captures [Upload media here]

Operating System

Windows

Operating system details

Windows 10

Flet version

v24.1

Regression

No, it isn't

Suggestions

No response

Logs

Logs ```console [Paste your logs here] ```

Additional details

No response

ndonkoHenri commented 3 weeks ago

Please share runnable to code to reproduce the issue. Preferably use urls as source so we can run it easily.