瀏覽代碼

Merge pull request #3050 from nextcloud/fixCanvasTooLarge

Fix CanvasTooLargeException
Andy Scherzinger 6 年之前
父節點
當前提交
a6910a3d13
共有 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;
             }
         }