diff options
| author | John Hoford <hoford@google.com> | 2012-10-24 11:15:49 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-24 11:15:50 -0700 |
| commit | de00ad0d02f4e328b93a1f5aa393dadf6e685033 (patch) | |
| tree | 15f4b28570f74c3632eb46f700261c3c89903c70 /src | |
| parent | a1d04a4aef8117fa0c98b34a931a18a7b46073e3 (diff) | |
| parent | 20ae55ef793f8a307fd0fc03a6010c36e7cbc56b (diff) | |
| download | android_packages_apps_Gallery2-de00ad0d02f4e328b93a1f5aa393dadf6e685033.tar.gz android_packages_apps_Gallery2-de00ad0d02f4e328b93a1f5aa393dadf6e685033.tar.bz2 android_packages_apps_Gallery2-de00ad0d02f4e328b93a1f5aa393dadf6e685033.zip | |
Merge "limited the size of textures to 2048" into gb-ub-photos-arches
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/gallery3d/filtershow/cache/ImageLoader.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/filtershow/cache/ImageLoader.java b/src/com/android/gallery3d/filtershow/cache/ImageLoader.java index ab1746d54..c25226548 100644 --- a/src/com/android/gallery3d/filtershow/cache/ImageLoader.java +++ b/src/com/android/gallery3d/filtershow/cache/ImageLoader.java @@ -234,6 +234,7 @@ public class ImageLoader { return null; } + static final int MAX_BITMAP_DIM = 2048; private Bitmap loadScaledBitmap(Uri uri, int size) { InputStream is = null; try { @@ -251,8 +252,11 @@ public class ImageLoader { int scale = 1; while (true) { - if (width_tmp / 2 < size || height_tmp / 2 < size) - break; + if (width_tmp <= MAX_BITMAP_DIM && height_tmp <= MAX_BITMAP_DIM) { + if (width_tmp / 2 < size || height_tmp / 2 < size) { + break; + } + } width_tmp /= 2; height_tmp /= 2; scale *= 2; |
