[BUG?] GIFs loaded into image component's source don't play

Potentially linked to SVG background in Image Component:

What I’m trying to do:
Load a GIF into an Image component using the Source property file loader

What I’ve tried and what’s not working:
If the GIF is loaded in to the app’s assets, and referenced in the source property of the Image component, the GIF plays normally. (he issue with this is that the Assets are lazy loaded so you have a round trip when using them for the first time.)

If it is loaded in using the file loader on the source property, it loads with the form quickly but the animation doesn’t play.

I suspect the issue is how the File Loader adds it into the source as it sets it to a MIME type of data:image/jpeg

yes, same if you fetch it from the datatable if i remember correcty

Have you tried grabbing the object from the file loader and changing its content type using a BlobMedia object?

Something like this

            file = #file from file loader
            new_file = BlobMedia("image/gif",file.get_bytes(),name="new_gif.gif")

Disclosure: This is untested but I do something similar to convert file types and resize files.

1 Like

That’s an interesting idea.

The FileLoader I am referring to is the one in the Image components properties window of the IDE. When you upload an image from your hard drive to that Image component it sets the image type automatically to be image/jpeg I think rather than image/gif

As a workaround I might try your approach and convert the image’s source text to a Blob and then assign it to the source and see what happens.

1 Like