Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

old frame stay #40

Open
zhenyuaf opened this issue Sep 24, 2021 · 0 comments
Open

old frame stay #40

zhenyuaf opened this issue Sep 24, 2021 · 0 comments

Comments

@zhenyuaf
Copy link

Use addFrame or addFrameImageData for more than two image, and 'getBase64GIF' to generate the gif, result get error, the first image does not display when the second image appear.

let gif = new Animated_GIF();
for (let i = 0; i < fileList.length; i++) {
let img = fileList[i];
gif.setSize(img.width, img.height);
gif.addFrame(img);
if (i==fileList.length-1) {
gif.getBase64GIF(b64=>{
let el = document.createElement('a');
el.href = URL.createObjectURL(base64ToBlob(b64));
el.download = 'file.gif';
document.body.appendChild(el);
let evt = document.createEvent("MouseEvents");
evt.initEvent("click", false, false);
el.dispatchEvent(evt);
document.body.removeChild(el);
})
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant