summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorJohn Hoford <hoford@google.com>2012-10-24 11:15:49 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-24 11:15:50 -0700
commitd62540b5ce2017d7f8045a648a1f04f7017891db (patch)
treef5aeed177260035bafccda6ea48edfcc9fb37d66 /src/com
parent30cea9fd7d02cffe4a15c58a61fa823fee29db42 (diff)
parente8410e06481f76a314724d010035aef729000b6a (diff)
downloadandroid_packages_apps_Snap-d62540b5ce2017d7f8045a648a1f04f7017891db.tar.gz
android_packages_apps_Snap-d62540b5ce2017d7f8045a648a1f04f7017891db.tar.bz2
android_packages_apps_Snap-d62540b5ce2017d7f8045a648a1f04f7017891db.zip
Merge "limited the size of textures to 2048" into gb-ub-photos-arches
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/gallery3d/filtershow/cache/ImageLoader.java8
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;