You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Requested option: Pause GIF animation at the end of the loop.
I realize this might be difficult to implement. Having not closely looked at the existing implementations, here are some suggested approaches, which I wouldn't be surprised if they are difficult or flat out impossible:
Override the GIF's internal "max loop" setting and set it to 1. (I wouldn't be surprised though if browsers don't even check this value any more and just assume "infinite looping.")
Detect when the last frame of animation is reached and stop animating.
Figure out the duration of an animation loop (sum of all frames' durations), attach a timer when the animation starts, and stop the animation when the timer ends.
The text was updated successfully, but these errors were encountered:
This would indeed be nice, but yeah, it's hard. Re the suggestions:
Override the GIF's internal "max loop" setting and set it to 1. (I wouldn't be surprised though if browsers don't even check this value any more and just assume "infinite looping.")
Theoretically doable (I think it's still supported), but it requires hooking all requests (slowing down browsing), and modifying their contents, incrementally, mid-transfer...
Detect when the last frame of animation is reached and stop animating.
The API I'm using in Firefox doesn't let me do this.
Figure out the duration of an animation loop (sum of all frames' durations), attach a timer when the animation starts, and stop the animation when the timer ends.
Doesn't work, because GIFs load incrementally.
Firefox does have an old and crufty flag for precisely this; you can set it for all GIFs via image.animation_mode = "once" in about:config, or programmatically for individual GIFs/images. It doesn't interact very well with this addon, though, because of various brokenness in the implementation and lack of APIs (for instance I can't tell whether an animation has completed, and thus whether to reset animation on hover and such). I would also not be surprised if that functionality was removed during various upcoming animGIF-related refactorings.
Most realistically I think this feature would either require adding new internal APIs to Firefox, or happen as part of adding some mode to the addon where it completely overrides GIF rendering, also allowing e.g. reversing of animations or stepping frame-by-frame. I don't have any plans for that though.
Requested option: Pause GIF animation at the end of the loop.
I realize this might be difficult to implement. Having not closely looked at the existing implementations, here are some suggested approaches, which I wouldn't be surprised if they are difficult or flat out impossible:
The text was updated successfully, but these errors were encountered: