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

Downsampler doesn't account for sample size when re-using Bitmaps #224

Closed
sjudd opened this issue Oct 30, 2014 · 0 comments
Closed

Downsampler doesn't account for sample size when re-using Bitmaps #224

sjudd opened this issue Oct 30, 2014 · 0 comments
Assignees
Labels
Milestone

Comments

@sjudd
Copy link
Collaborator

sjudd commented Oct 30, 2014

If we try to load a 200x200 image from a 2000x2000 image, Downsampler will try to retrieve a 2000x2000 image to re-use on KitKat+. We should instead take sample size into account when trying to retrieve a Bitmap. Otherwise our hit rate is quite poor.

It's a little complicated because we can pass any integer sample size to BitmapFactory but it will use some power of two rather than the number we give. BitmapFactory appears to use the nearest power of 2 that is less than or equal to the sample size we provide.

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