压缩机回零

我正在尝试使用Compressor库压缩图像,问题在于它会将Null返回给位图变量。

我的代码:

if (requestCode == GALLERY_PICK_CODE && resultCode == RESULT_OK) {
    Uri chosenImageUri = data.getData();

     File thumb_file = new File(chosenImageUri.getPath());
            //getting Bitmap
             Bitmap thumb_bitMap = new Compressor(this)
                    .setMaxWidth(640)
                    .setMaxHeight(480)
                    .setQuality(75)
                    .compressToBitmap(thumb_file);

     Log.d("thumb_bm",String.valueOf( (thumb_bitMap==null) ) );
}

我已经检查并且 chosenImageUri 不为空

这里有没有人遇到过这个问题? 我该如何解决?

rmb001 回答:压缩机回零

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2986176.html

大家都在问