Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gif frame timing is not always obeyed #205

Closed
sjudd opened this issue Oct 20, 2014 · 3 comments
Closed

Gif frame timing is not always obeyed #205

sjudd opened this issue Oct 20, 2014 · 3 comments
Labels
Milestone

Comments

@sjudd
Copy link
Collaborator

sjudd commented Oct 20, 2014

Sample URLs:

http://giphy.com/gifs/horror-cartoon-simpsons-WJfhOzOgXOLle
http://media1.giphy.com/media/WJfhOzOgXOLle/giphy.gif

@sjudd sjudd added the bug label Oct 20, 2014
@sjudd sjudd added this to the 3.4 milestone Oct 20, 2014
@sjudd
Copy link
Collaborator Author

sjudd commented Oct 22, 2014

We're not the only ones to have this problem, great discussion around Mozilla's defaults from a while ago: https://bugzilla.mozilla.org/show_bug.cgi?id=125137

@sjudd
Copy link
Collaborator Author

sjudd commented Oct 22, 2014

A couple of points.

  1. We need to choose a default and/or a minimum timing, some GIFs will write 0, some will write between 1 and 10 (hundredths of a second) and expect it to be 10 because that's IE's minimum.
  2. -1 for a frame delay is supposed to indicate display forever. Definitely less critical to obey this.

I'm inclined to follow IE and set 10 100ths of a second as the minimum frame delay. It's slow, but our decoder is limited to maybe one frame every 30 ms at best anyway and it will save battery life.

@sjudd
Copy link
Collaborator Author

sjudd commented Oct 22, 2014

Here's a nice set of samples showing how modern browsers handle these values:

http://nullsleep.tumblr.com/post/16524517190/animated-gif-minimum-frame-delay-browser-compatibility.

After testing 100ms per frame is too slow. I'll set the minimum at 30ms and default to 100ms for GIFs with a frame delay set to less than 30ms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant