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

Little issue #3

Open
Fossor opened this issue Sep 6, 2014 · 0 comments
Open

Little issue #3

Fossor opened this issue Sep 6, 2014 · 0 comments

Comments

@Fossor
Copy link

Fossor commented Sep 6, 2014

Hi there!
Thanks for a great stuff!
I think you have little miscalculation in ImageResizer->calculateInSampleSize

long totalPixels = width * height / inSampleSize;

should be

long totalPixels = width / inSampleSize * height / inSampleSize;

and then

while (totalPixels > totalReqPixelsCap) {
                inSampleSize *= 2;
                totalPixels /= 2;
            }

should be

while (totalPixels > totalReqPixelsCap) {
                inSampleSize *= 2;
                totalPixels /= 4;
            }

After that you can instantiate ImageInternalFetcher with a smaller size (closer to the size of a thumb)

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