Pārlūkot izejas kodu

分辨率调整

詹子聪 5 gadi atpakaļ
vecāks
revīzija
215dcf509b

+ 4 - 4
app/src/main/java/com/miekir/ocr/ui/OperationPresenter.java

@@ -77,9 +77,9 @@ public class OperationPresenter extends BasePresenter<IOperationView> {
                     }
 
                     int max = rotatedBitmap.getWidth() > rotatedBitmap.getHeight() ? rotatedBitmap.getWidth() : rotatedBitmap.getHeight();
-                    int multi = 1;
-                    if (max > 1000) {
-                        multi = max / 1000;
+                    float multi = 1.0f;
+                    if (max > 2000) {
+                        multi = 1.0f * max / 2000 + 0.5f;
                     }
 
                     if (multi > 1) {
@@ -407,7 +407,7 @@ public class OperationPresenter extends BasePresenter<IOperationView> {
                 int max = rotatedBitmap.getWidth() > rotatedBitmap.getHeight() ? rotatedBitmap.getWidth() : rotatedBitmap.getHeight();
                 float multi = 1.0f;
                 if (max > 2000) {
-                    multi = 1.0f * max / 1000 + 0.5f;
+                    multi = 1.0f * max / 2000 + 0.5f;
                 }
 
                 // 压缩图片