public static Uri getPickImageResultUri(@NonNull Context context, @Nullable Intent data) {
    boolean isCamera = true;
    if (data != null && data.getData() != null) {
      String action = data.getAction();
      isCamera = action != null && action.equals(MediaStore.ACTION_IMAGE_CAPTURE);
    }
    return isCamera || data.getData() == null ? getCaptureImageOutputUri(context) : data.getData();
  }
Get the URI of the selected image from {@link #getPickImageChooserIntent(Context)}.<br>
Will return the correct URI for camera and gallery image.

@param context used to access Android APIs, like content resolve, it is your
    activity/fragment/widget.
@param data the returned data of the activity result
core/src/main/java/com/theartofdev/edmodo/cropper/CropImage.java