Browse Source

Merge pull request #3050 from nextcloud/fixCanvasTooLarge

Fix CanvasTooLargeException
Andy Scherzinger 6 năm trước cách đây
mục cha
commit
a6910a3d13
1 tập tin đã thay đổi với 1 bổ sung2 xóa
  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;
             }
         }