浏览代码

fix CanvasTooLargeException

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 6 年之前
父节点
当前提交
6909794879
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/main/java/com/owncloud/android/utils/BitmapUtils.java

+ 1 - 2
src/main/java/com/owncloud/android/utils/BitmapUtils.java

@@ -104,8 +104,7 @@ public final class BitmapUtils {
 
             // calculates the largest inSampleSize value (for smallest sample) that is a power of 2 and keeps both
             // height and width **larger** than the requested height and width.
-            while ((halfHeight / inSampleSize) > reqHeight
-                    && (halfWidth / inSampleSize) > reqWidth) {
+            while ((halfHeight / inSampleSize) > reqHeight || (halfWidth / inSampleSize) > reqWidth) {
                 inSampleSize *= 2;
             }
         }