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

Losing graphic control extension for some frames #30

Open
jeetiss opened this issue Mar 21, 2021 · 1 comment
Open

Losing graphic control extension for some frames #30

jeetiss opened this issue Mar 21, 2021 · 1 comment

Comments

@jeetiss
Copy link
Contributor

jeetiss commented Mar 21, 2021

this gif contains 2 application blocks in a row, so first frame lose gce info and renders without transparency

Снимок экрана 2021-03-21 в 13 02 16

I fix it on my side, with this workaround

const validateAndFix = (gif) => {
  let currentGce = null;
  for (const frame of gif.frames) {
    currentGce = frame.gce ? frame.gce : currentGce;

    // fix loosing graphic control extension for same frames
    if ("image" in frame && !("gce" in frame)) {
      frame.gce = currentGce;
    }
  }
};

but I think that a better way is fix this library or improve loop condition for frames inside https://github.com/matt-way/jsBinarySchemaParser

@jeetiss jeetiss changed the title Loosing graphic control extension in some cases Loosing graphic control extension for some frames Mar 21, 2021
@jeetiss jeetiss changed the title Loosing graphic control extension for some frames Losing graphic control extension for some frames Mar 21, 2021
flyskywhy added a commit to flyskywhy/gifuct-js that referenced this issue Jan 5, 2023
@flyskywhy
Copy link

@flyskywhy/gifuct-js fixed it.

Also you may ref to pixel-gif and it's react-native version react-native-pixel-gif

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

2 participants