benwiley4000 / gif-frames

🖼 Extract frames from an animated GIF with pure JS
MIT License
167 stars 26 forks source link

For gifs larger than 500kb, image data lost in frames #4

Closed ankampraveen closed 6 years ago

ankampraveen commented 7 years ago

giphy 1

i am testing with above gif (30 frames), and i have image data only in 2-3 frames, in all other frames image data is lost (only part of image is present)

Below is my code

gifFrames({ url : "sample.gif", frames : 'all', outputType : 'canvas' }).then(function(frameData) { for(var i=0; i<frameData.length;i++) { document.body.append(frameData[i].getImage()) }

})

benwiley4000 commented 6 years ago

Sorry, I accidentally wasn't watching my own repository!

Thanks for reporting - I'll look into this.

benwiley4000 commented 6 years ago

Hey @ankampraveen do you think your issue is similar to the one reported in #5 and if so does the partial solution I provided there help at all?

benwiley4000 commented 6 years ago

@ankampraveen would you be able to test the branch issue/5-missing-pixels (#6) and let me know if it solves your issue? npm install && npm run build should generate the browser files for you.

benwiley4000 commented 6 years ago

I think this is the same issue as #5 so I'm closing. Feel free to reopen if your issue isn't solved by the version of the code in master (I'll also be releasing a new version later tonight).

benwiley4000 commented 6 years ago

v0.4.0 released to npm!

ankampraveen commented 6 years ago

Sorry, i did not checked your response. I just tested with the lastest version, i still observe same issue can you please debug with GIF which i provided ?

benwiley4000 commented 6 years ago

@ankampraveen I just tested with your cat GIF. It does have the same problem if you run the code from the original post - I should have clarified you need to add a new option.

Adding the new option cumulative: true should fix it (for more details see here).

I tested your GIF with cumulative: true and it worked.

screenshot from 2018-03-31 10-31-52