Skip to content

Commit

Permalink
Fix bug for #21
Browse files Browse the repository at this point in the history
  • Loading branch information
wildma committed May 30, 2020
1 parent 97f9b4f commit bf1012a
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
import android.os.Build;
import android.os.Environment;
import android.provider.MediaStore;
import androidx.core.content.FileProvider;
import android.widget.Toast;

import java.io.File;
import java.io.FileNotFoundException;

import androidx.core.content.FileProvider;


/**
* Author wildma
Expand Down Expand Up @@ -167,8 +168,8 @@ public static Intent crop(Activity activity, Uri uri, int w, int h, int aspectX,
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setDataAndType(uri, "image/*");
intent.putExtra("crop", "true");
if (aspectX / aspectY == 1) {
/*宽高比例为 1:1 时,华为设备的系统默认裁剪框是圆形的,这里统一改成方形的*/
if (aspectX == aspectY) {
/*宽高比例相同时,华为设备的系统默认裁剪框是圆形的,这里统一改成方形的*/
if (Build.MANUFACTURER.equals("HUAWEI")) {
aspectX = 9998;
aspectY = 9999;
Expand Down

0 comments on commit bf1012a

Please # to comment.