bitmapfactory.decodefile()在内存中存在文件时返回null
我在内部内存中有以下JPG映像,但是bitmapfactory.decodefile
返回null
:
File imgFile = new File("/data/user/0/com.arthenica.ffmpegkit.test/files/t.jpg");
// same result for `File imgFile = new File(getContext().getFilesDir(), "t.jpg");`
Bitmap bitmap = null;
if(imgFile.exists()){
BitmapFactory.Options bmOptions = new BitmapFactory.Options();
bitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath(), bmOptions); // null
}
它可以检测到该imgfile ,但返回值为null。有人知道可能是什么原因吗?
I have the following jpg image in the internal memory, but BitmapFactory.decodeFile
returns null
:
File imgFile = new File("/data/user/0/com.arthenica.ffmpegkit.test/files/t.jpg");
// same result for `File imgFile = new File(getContext().getFilesDir(), "t.jpg");`
Bitmap bitmap = null;
if(imgFile.exists()){
BitmapFactory.Options bmOptions = new BitmapFactory.Options();
bitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath(), bmOptions); // null
}
It can detect that imgFile
exists, but the return value is null. Does anyone know what might be the reason?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论