From c60f487e401b57bca03930204d93ad248e6323a6 Mon Sep 17 00:00:00 2001 From: Owen Lin Date: Tue, 13 Sep 2011 20:48:13 +0800 Subject: (DO NOT MERGE) Add a hard limit on the size of the widget images. There is a limit on the size of the data transfered by binder. For now, we just add a hard limit (360 pixel) to ensure the widget's image can be passed by binder. Also adjust the size of widget to make it looks better. Fix a bug in DecodeUtils which cause OOM for a image in size 12200x1920. In that case, we should generate a screen nail of size 640x101 instead of 4066x640. Change-Id: Ie42805d9e9e579b063fc99f5130ec433d695b8c9 fix: 5273271 --- gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java b/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java index aaf4f6665..060d7f32e 100644 --- a/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java +++ b/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java @@ -85,7 +85,7 @@ public class BitmapUtils { // minSideLength long. If that's not possible, return 1. public static int computeSampleSizeLarger(int w, int h, int minSideLength) { - int initialSize = Math.min(w / minSideLength, h / minSideLength); + int initialSize = Math.max(w / minSideLength, h / minSideLength); if (initialSize <= 1) return 1; return initialSize <= 8 -- cgit v1.2.3