Skip to content Skip to sidebar Skip to footer

Determine Gif Animation Status?

Is there any way to detect via javascript whether a GIF image's animation is completed or not?

Solution 1:

No, it is not. Javascript cannot manipulate GIF directly. But maybe jsgif can help you

Solution 2:

By now it's possible. There are packages available to extract information from byte buffer. Like gif-info.

Combining that with HTMLImage.onload it's possible to start timeout exactly with delay when animation should already ended.

Or having duration value we can set up CSS animation on target image that would work in more stable way.

But although it's technically possible it still looks as overkill.

Post a Comment for "Determine Gif Animation Status?"