summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorJohn Hoford <hoford@google.com>2012-10-24 11:08:01 -0700
committerJohn Hoford <hoford@google.com>2012-10-24 11:08:01 -0700
commite8410e06481f76a314724d010035aef729000b6a (patch)
tree6037995ac189f04c113bb45816dfeaaac59302f6 /src/com
parentb89ad7cf365087de7ca11166bcfbfecbe4584b98 (diff)
downloadandroid_packages_apps_Snap-e8410e06481f76a314724d010035aef729000b6a.tar.gz
android_packages_apps_Snap-e8410e06481f76a314724d010035aef729000b6a.tar.bz2
android_packages_apps_Snap-e8410e06481f76a314724d010035aef729000b6a.zip
limited the size of textures to 2048
bug:7404007 Change-Id: I77fac900e213ca16c2accfa8f59d0cd300559836
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;