pixijs / gif

Plugin to support playback of animated GIF images in PixiJS.
https://pixijs.io/gif/docs/
MIT License
37 stars 5 forks source link

Frame index out of the range #2

Closed AgustinLaValla closed 2 years ago

AgustinLaValla commented 2 years ago

First of all, thanks for the plugin. really help me in my current project. I'm having this issue when following the steps shown in the documentation: image

I cannot figure out what's going on. Here is an example of the code: https://codesandbox.io/s/pjijs-gif-frnug

AgustinLaValla commented 2 years ago

I've found the issue. It is in the static fromBuffer method. There is an iteration over the gifFrames, in which the frame delay is being used to make a time calculation. But in same cases, the delay value is undefined so the that the result is 'NaN'. Since I need this working asap for my project I copied the plugin code and added this line of code:

image

If the issue ever get fixed, I will install the module again. By the way, thanks so much for the plugin, It has been a great help to me

bigtimebuddy commented 2 years ago

Fixed in 1.0.2 :+1: thanks for letting me know.

This was caused by this: https://github.com/matt-way/gifuct-js/issues/18

I also updated the demo to add this GIF. https://pixijs.io/gif/demo/