OSDN Git Service

Fix of memory issues with bitmaps in filmstrip.
authorSascha Haeberling <haeberling@google.com>
Fri, 30 Aug 2013 00:28:49 +0000 (17:28 -0700)
committerSascha Häberling <haeberling@google.com>
Fri, 30 Aug 2013 00:47:35 +0000 (00:47 +0000)
  Bug: 10495593

We should use the bigger scale factor of the two, and not the smaller.

Change-Id: I5a1ff6fe7d6b50c0128ff17709daa94cef9cb65b

src/com/android/camera/data/LocalMediaData.java

index f692cbc..9391892 100644 (file)
@@ -471,7 +471,7 @@ public abstract class LocalMediaData implements LocalData {
                 if (mWidth > mDecodeWidth || mHeight > mDecodeHeight) {
                     int heightRatio = Math.round((float) mHeight / (float) mDecodeHeight);
                     int widthRatio = Math.round((float) mWidth / (float) mDecodeWidth);
-                    sampleSize = heightRatio < widthRatio ? heightRatio : widthRatio;
+                    sampleSize = Math.max(heightRatio, widthRatio);
                 }
 
                 BitmapFactory.Options opts = new BitmapFactory.Options();