loopj / android-smart-image-view

Android ImageView replacement which allows image loading from URLs or contact address book, with caching
http://loopj.com/android-smart-image-view/
1.3k stars 510 forks source link

Out of memory exception. #13

Closed vinceve closed 11 years ago

vinceve commented 11 years ago

This problem will fix most people out of memory exception. I took a higher sample size and now it seems to work properly.

loopj commented 11 years ago

Thanks @vinceve and @siddharthmenon !

ffleandro commented 11 years ago

After this patch my images get all blurry.

BuddhaSource commented 11 years ago

EDIT : I am sorry this answer was intended for this commit https://github.com/siddharthmenon/android-smart-image-view/commit/7a1c1a6a8e03186e73742c7a2760524ec9c29acf

That is quite possible when you are out of memory. The logic is something like this.

It will continue to load images as intended, no quality loss. But when ever you are out of memory while loading the bitmap, it handles out of memory exception (no force crash) and again tries to load the scaled down version of it, reducing the memory footprint.

If you don't load the scaled down version essentially the bitmap will be null. We are using this with our app and I am sure we are not loosing quality when we have memory to play with. Check http://3Crumbs.com/app

vinceve commented 11 years ago

I will look at it this evening. The update fixed the out of memory issue idd. The blurry images could also occur because the sampling of the bitmap is reduced. I will test it.

2013/2/7 Siddharth Menon notifications@github.com

That is quite possible when you are out of memory. The logic is something like this.

It will continue to load images as intended, no quality loss. But when ever you are out of memory while loading the bitmap, it handles out of memory exception (no force crash) and again tries to load the scaled down version of it, reducing the memory footprint.

If you don't load the scaled down version essentially the bitmap will be null. We are using this with our app and I am sure we are not loosing quality when we have memory to play with. Check 3Crumbs.com/app

— Reply to this email directly or view it on GitHubhttps://github.com/loopj/android-smart-image-view/pull/13#issuecomment-13266887.