Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

压缩时一直loading,且有不小的概率会Crash #404

Open
jerry9433 opened this issue Sep 20, 2022 · 3 comments
Open

压缩时一直loading,且有不小的概率会Crash #404

jerry9433 opened this issue Sep 20, 2022 · 3 comments

Comments

@jerry9433
Copy link

华为mate30Pro,鸿蒙系统
v3.10.6
已经设置targetSdk = 29和android:requestLegacyExternalStorage="true"

public class ImageCompressEngine implements CompressFileEngine {

    @Override
    public void onStartCompress(Context context, ArrayList<Uri> source, OnKeyValueResultCallbackListener call) {
        Luban.with(context).load(source).ignoreBy(500)
                .filter(path -> PictureMimeType.isUrlHasImage(path) && !PictureMimeType.isHasHttp(path))
                .setCompressListener(new OnNewCompressListener() {
                    @Override
                    public void onStart() {

                    }

                    @Override
                    public void onSuccess(String source, File compressFile) {
                        LogUtils.i("localMediaCompress",source);
                        if (call != null) {
                            call.onCallback(source, compressFile.getAbsolutePath());
                        }
                    }

                    @Override
                    public void onError(String source, Throwable e) {
                        LogUtils.i("localMediaCompress", source);
                        LogUtils.i("localMediaCompress", e.getMessage());
                        if (call != null) {
                            call.onCallback(source, null);
                        }
                    }
                }).launch();
    }
}

稍微大点的图片,2-3M的,手机拍照的,就会loading很长时间,一张差不多2分钟左右吧,且大几率会crash

@tianshaokai
Copy link

有具体的 图片和 crash 吗,优化了一些Crash

@zhaoxiuyu
Copy link

@tianshaokai https://github.com/tianshaokai/Luban 这个是你单独维护的一版吗

@tianshaokai
Copy link

@zhaoxiuyu 是的 转换了androidx, 修改了部分空指针,打算维护一下这个库,供大家使用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants