Skip to content

Invalid LZW code #22

@EmilienLeroy

Description

@EmilienLeroy

Trouble

I'm tried to split some gifs using the readme example and i get this error Uncaught Error: Invalid LZW code . When i set false into the split() params it work but some frame isn't complete.

Example

For example here each two frame, the floor is missing :
image

Code

import gifken from 'gifken';

var xhr = new XMLHttpRequest();
xhr.open("GET", './assets/200.gif', true);
xhr.responseType = "arraybuffer";
xhr.onload = function (e) {
    var arrayBuffer = e.target["response"];
    var gif = gifken.Gif.parse(arrayBuffer);

    gif.split(false).forEach(function (i) {
        var img = new Image();
        var blob = gifken.GifPresenter.writeToBlob(i.writeToArrayBuffer());
        img.src = URL.createObjectURL(blob);
        document.body.appendChild(img);
    });
};
xhr.send();

I'm using the 2.1.1 version of gifken.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions