LuckSiege / PictureSelector

Picture Selector Library for Android or 图片选择器
Apache License 2.0
13.23k stars 3k forks source link

压缩完成时调用call.onCallback()函数的第一个参数问题 #2850

Open moyergo opened 6 months ago

moyergo commented 6 months ago

Current use version?

当前使用的版本是多少?

3.11.2;Android 14

Will this problem occur in demo?

Demo能否复现这问题?

可以

Describe the problem or provide an error log?

在执行压缩后,调用onCallback时,第一个参数不能用uri.getPath(),否则内部“LocalMedia media = queue.get(srcPath)”为null。需要用 uri.toString()。

setCompressEngine(CompressFileEngine { context, source, call ->
        source.forEach { uri ->
               // 压缩逻辑。。。忽略
               /* 在调用onCallback时,第一个参数不能用uri.getPath(),否则内部“LocalMedia media = queue.get(srcPath)”为null。需要用 
                uri.toString()。*/
               call?.onCallback(it.toString(), compressFile.absolutePath)
       }
})