Repository navigation
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
I apologize for the clickbaity title, but the opportunity was too good to pass.
The issue is that, unlike all other GIF renderers out there, Flutter's GIF renderer actually renders frames with the specified delay, even if it's 0 or 10ms (0 or 1 in the GIF file). While this behavior conforms to the GIF89a spec, the problem is that everybody else doesn't conform — such short delays are usually artificially set to 100ms.
You can read more about this fascinating phenomenon in this article: https://www.biphelps.com/blog/The-Fastest-GIF-Does-Not-Exist. The article contains example GIFs and is a deep dive into the topic.
Because of this behavior, there are already GIFs in the wild that render too fast in Flutter. I think it would make sense to align with the rest of the world, just to existing files render the same as everywhere else.
Expected results
Frames with the delay set to 0 (0ms) or 1 (10ms) have their delay expanded to 100ms.
Actual results
The frames are rendered so fast, they're imperceptible.
Code sample
Code sample
In this example, I've used the smallest GIF from the article mentioned above and added sliders to customize the delays of frames with black and red cells.
This is a customizable equivalent to the "No Delay" section of said article.
Screenshots or Video
Screenshots / Video demonstration
These images come from the article mentioned above.
Flutter's (spec-conformant) behavior.
The actual GIF as rendered by your current browser
Logs
No response
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.4.1 22F770820d darwin-arm64, locale pl-CH)
• Flutter version 3.10.5 on channel stable at /Users/evol/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 796c8ef792 (5 weeks ago), 2023-06-13 15:51:02 -0700
• Engine revision 45f6e00911
• Dart version 3.0.5
• DevTools version 2.23.1
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2)
• Android SDK at /Users/evol/Library/Android/sdk
• Platform android-33, build-tools 33.0.0-rc2
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14E300c
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2022.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
[✓] IntelliJ IDEA Community Edition (version 2023.1.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.80.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 13.4.1 22F770820d darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 114.0.5735.198
[✓] Network resources
• All expected network resources are available.
• No issues found!


Activity
moffatman commentedon Jul 16, 2023
Related: #80030
Personally I just fix it in my personal fork by applying the above
TKDev7 commentedon Jul 17, 2023
This looks like a duplicate of #29130
huycozy commentedon Jul 17, 2023
Hi @evoL
I'm not familiar with GIF89a specs. Can you check the linked issue above #29130 if it's similar to this case?
evoL commentedon Jul 17, 2023
Hey, #29130 does look like the same thing. Feel free to mark this as a duplicate.
Thanks everybody for letting me know!
github-actions commentedon Jul 31, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.