Browse Source

fix CanvasTooLargeException

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 6 years ago
parent
commit
6909794879
1 changed files with 1 additions and 2 deletions
  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;
             }
         }