You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Luban Hey guys, hope everything going well! That would be nice if you have time to look into this problem, thanks in advance! 🙏🏾
I encountered the same problem when I was testing on the Android 12 emulator and set back camera from VirtualScene to Emulated(#430 and #428), as the following code shows:
Luban.with(mContext)
.load(file)
.ignoreBy(100)
.setTargetDir(getPath())
.setCompressListener(object : OnCompressListener {
override fun onStart() {}
override fun onSuccess(compressedFile: File) {
refreshDataSource(compressedFile.path)
}
override fun onError(e: Throwable) {
e.printStackTrace()
}
})
.launch()
}
Although I invoked the setTargetDir() method to set the compressed file directory, the original image path returned in the callback method onSuccess().
Before compression:/storage/emulated/0/Android/data/com.xxx.test/files/Pictures/JPEG_20220310_2140888612150486718.jpg
After compression:/storage/emulated/0/Android/data/com.xxx.test/files/Pictures/JPEG_20220310_2140888612150486718.jpg
android 11, 没有使用setTargetDir()方法,压缩后返回原图片的相对路径
代码:
Luban.with(context)
.load(uri)
.ignoreBy(100)
//.setTargetDir(dir.getAbsolutePath())
.filter(path -> {
return !(TextUtils.isEmpty(path));
})
.setCompressListener(onCompressCallback)
.launch();
压缩后的图片:/camera_photos/Pictures/JPEG_20211011_140125.jpg
The text was updated successfully, but these errors were encountered: