jnordberg / gif.js

JavaScript GIF encoding library
http://jnordberg.github.io/gif.js/
MIT License
4.74k stars 668 forks source link

How to debug and why gif.js does not work on mobile? #146

Open j4nos opened 1 year ago

j4nos commented 1 year ago

Using gif.js for GIF rendering: https://jnordberg.github.io/gif.js/

It works really nice, but on mobile it does not finish. Unfortunatelly I do not know how to debug. The completion handler is not get called, that sure. In Desktop running the app, after each rendered frame there is a log plotted. That tells a lot, but it is not available in mobile.

gif.on('finished', function(blob) {
  window.open(URL.createObjectURL(blob));
});

Is mobile rendering so much resource intensive?

flyskywhy commented 1 year ago

You can try gifenc

Because my react-native-gifencoder is also some fork of gif.js

But in my react-native-runescape-text I replace react-native-gifencoder with gifenc for Fix when one color e.g. '#ff0000' only have 1 or 2 or 3 pixel in one frame, the generated gif pixel will be '#9f0000'; fix some frame not transparent but black; reduce gif size 10x