Animated AVIF image support #1998
-
|
Hi, I have successfully added static (non-animated) AVIF image support to my image viewer, ImageFan Reloaded. However, when attempting to support animated AVIF images, the animation rendering freezes and lags, taking a long time to switch across animation frames. I am using the following code in ImageFile.cs. This code works correctly for animated GIF and WEBP files. Is there a different kind of animation processing necessary for AVIF images, as opposed to GIF and WEBP images? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
I got the feeling that you are asking me to debug your code? It could be a bug in the library but right now it feels like I need to make a lot of guesses. Would it be possible to create a small sample that explain the issue you are running into? |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the update, @dlemstra! It wasn't about debugging the code, rather I thought there might be a (known) issue involving AVIF animations that could quickly come to mind. I think I have found the culprit. When using the animated AVIF examples from https://colinbendell.github.io/webperf/animated-gif-decode/avif.html, MagickImage.AnimationDelay is read incorrectly from the images, resulting in very large values (1001, 512, and 512, respectively). According to the documentation, and the way it is implemented for animated GIFs and WEBPs, AnimationDelay is represented in units of "1/100ths of a second", thus these animation delays are 10, 5 and 5 seconds, respectively. Of course, dividing the values read from MagickImage.AnimationDelay by a scalar, such as 100, results in the animation delay becoming manageable, and the animated image looking somewhat similar to what a web browser would display, but it seems to me like programming by coincidence. |
Beta Was this translation helpful? Give feedback.
That scalar value should be stored in
AnimationTicksPerSecond?