我在我的项目中使用https://github.com/jhansireddy/AndroidScannerDemo这个扫描库。
当我捕获图像时,我在控制台中获取D/skia: --- Failed to create image decoder with message 'unimplemented'
,捕获的图像在Android 中设置为imageview。
另外,当我在,Android,中测试相同的应用程序时,我得到的错误小于错误。
2020-02-05 11:32:23.668 9270-9270/? E/ReviewScreenImpl: onClickOKButton() - Fail to decode captured picture
有谁能帮上忙吗?
发布于 2020-03-31 11:16:20
我也有同样的问题,而且似乎getResources中有一个bug,而不是您使用的库中,因为我没有使用它。但是,您可以使用ResourcesCompat,如下所示:
val myLogo = (ResourcesCompat.getDrawable(this.resources, R.drawable.ic_home_black_24dp, null) as VectorDrawable).toBitmap()
或
val myLogo = (ResourcesCompat.getDrawable(this.resources, R.drawable.ic_home_black_24dp, null) as BitmapDrawable).bitmap
取决于可绘制的类型(矢量或图像)。
请注意,这只会在API > 22上运行。
发布于 2020-08-20 19:22:36
请将图像字节字符串传递到解码器BitmapFactory.decodeStream方法中,而不是传递简单字符串。
发布于 2020-10-02 18:08:33
确保您已经生成了图像Uri,您将发送到相机应用程序与FileProvider。
相机应用程序在返回Activity.RESULT_OK之前保存图片的图像uri应该用FileProvider生成,如下所示
FileProvider.getUriForFile(
context,
context.getString(R.string.file_sharing_authority),
File(filePath)
有关如何将我们的文件共享给其他要读取或写入的应用程序(如照相机应用程序)的更多信息,请参见https://developer.android.com/reference/androidx/core/content/FileProvider。
https://stackoverflow.com/questions/60070017
复制相似问题