-
Notifications
You must be signed in to change notification settings - Fork 1.5k
vivo x6a图片压缩失败 #154
Copy link
Copy link
Open
Description
错误信息:图片压缩失败:null is compress failures picturePath:null
使用的方法是 void onPickFromGalleryWithCrop(Uri outPutUri, CropOptions options);
具体代码是
public static void onPickBySelectClick(TakePhoto takePhoto, File file, CompressConfig config, CropOptions options) {
takePhoto.onEnableCompress(config, true);
// 图片保存的路径
Uri outPutUri = Uri.fromFile(file);
takePhoto.onPickFromGalleryWithCrop(outPutUri, options);
}
CompressConfig config = new CompressConfig.Builder().setMaxSize(102400).setMaxPixel(800).create();
CropOptions cropOptions = new CropOptions.Builder().setAspectX(3).setAspectY(2).setWithOwnCrop(false).create();
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
ImageUtil.onPickBySelectClick(getTakePhoto());
} else {
ImageUtil.onPickBySelectClick(getTakePhoto(), file, config, cropOptions);
}
不启用压缩和裁剪就可以工作了,但是这又不符合产品需求。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels