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

Gif frames are sometimes partially decoded #207

Closed
sjudd opened this issue Oct 21, 2014 · 1 comment
Closed

Gif frames are sometimes partially decoded #207

sjudd opened this issue Oct 21, 2014 · 1 comment
Assignees
Labels
Milestone

Comments

@sjudd
Copy link
Collaborator

sjudd commented Oct 21, 2014

Similar to #204, except that I've only seen this after restarting a GIF. Just loading the gif and letting it play doesn't appear to reproduce this.

@sjudd sjudd added the bug label Oct 21, 2014
@sjudd sjudd added this to the 3.4 milestone Oct 21, 2014
@sjudd
Copy link
Collaborator Author

sjudd commented Oct 21, 2014

There are two causes:

  1. We load a frame from the memory cache and the next frame from the decoder.
  2. We load a frame from active resources and the next frame from the decoder.

When we load a frame from cache or active resources, the decoder does not contain the image data for that frame. Certain disposal types require the data from the previous frame to be the starting point for the next frame. When this data isn't available, we see partially filled out frames.

@sjudd sjudd self-assigned this Oct 21, 2014
sjudd added a commit to sjudd/glide that referenced this issue Oct 21, 2014
Each time we call get() on a drawable resource, we
get a new Drawable. We call get() repeatedly on
resources when they are retrieved from either the
set of active resources or the in memory cache.
Each time we create a new GifDrawable it holds on
to one or two temporary Bitmaps outside it's
shared state to render the current frame and obey
the dispose_previous method. This change means we
more aggressively cleanup those resources when
we think each Drawable is no longer being used.
The side affect is that we may reset back to
the beginning of the Drawable in some
circumstances.

Cleanup in in memory resources makes it less
likely that frames would be retrieved from
in memory, so this also works toward bumptech#207.
@sjudd sjudd closed this as completed in b4cc7fa Oct 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant