When people post animated gifs they play over and over and over and over and over and…
Twitter gives me a way to make the animation stop. Slack lets me collapse the image so I don’t see it anymore. Please, please Discourse give me something comparable.
Great feature request @ganncamp, thank you. This is now done (commit) and deployed here on meta. Clicking on the image will pause and then unpause the animation. Due to browser security limitations, the pausing shows only the first frame of the image, it can’t show the frame on the moment it was clicked.
Maybe we do a small “paused” overlay, so people learn what happened. (a translucent II at the bottom right?)
I think, (though I am not sure) that this only works after the gif fully loaded. Some animated gifs can take a while to load. Can you test maybe on local using throttling to see that this pauses even if the gif is not fully loaded?
It wouldn’t pause. I tried two browsers.
I came to this thread as I’d read it the other day.
Clicked on the STOP IT gif and it paused.
Back to my post and that now pauses.
Thanks Geoff, the technical reason why your upload doesn’t work is because this currently only works for uploads that are in the DB. Your upload above is a giphy URL, it doesn’t have a local upload record. We can’t easily extend this to animated images from other URLs because we don’t know for sure if an asset on a specific URL is an animated image or a regular static image.
We can make an educated guess, for giphy URLs for example, but unless the upload is local and processed, we won’t know for sure.
Update: ah, and now the giphy upload in your post above was downloaded locally, and the pausing works.
The pause action works, but the canvas can’t read/draw the first frame until the GIF has fully loaded. I don’t think we can properly fix this, so I added a subtle background color to the canvas element, which will display like this: