Displaying GIFs

Is there a native way to show animated gifs? The image component just shows a static picture.

I could run a timer and flick between the images, but wondered if there was a built in way.

1 Like

Hrm. It’s not an Officially Supported Feature™, but the status GIFs on our internal dashboard appear to work just fine :smiley:

Just a thought: Did you upload the image via the Upload button in the Image component’s source attribute? Because that autoconverts to JPEG to save space. You might want to try uploading the GIF as an asset, and setting the Image’s source to something like _/theme/my-file.gif…

6 Likes

Ah, yes I did. And your suggestion does indeed work.

Ta muchly.

This works, but the GIF strangely only loops one time. On the bright side, the disappearing gif has some mystique.

I can get a looping GIF to work using the /_/theme/file.gif method. Have you verified that the GIF does indeed loop? Sometimes when you edit a GIF, the image editor stops it looping - Mac OS’s Preview app does that.

https://anvil.works/build#clone:OFTJIDUY6IVIG2KJ=4VHNLAWLFCDRHADPX7L6R6FQ

(Yes, I know it’s not obvious from that that the GIF is looping, but I thought it was pretty… and if you clone it and watch it for an hour you’ll realise it must be looping!)

1 Like

I’m up to 30 minutes so far.

Are you sponsored by Derren Brown?

2 Likes