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

初始化网络图片,再选择相册,压缩卡住 #2427

Closed
xxhh07 opened this issue Jul 21, 2022 · 0 comments
Closed

初始化网络图片,再选择相册,压缩卡住 #2427

xxhh07 opened this issue Jul 21, 2022 · 0 comments

Comments

@xxhh07
Copy link

xxhh07 commented Jul 21, 2022

Current use version?

当前使用的版本是多少?

v 3.10.5

操作步骤:

先LocalMedia.generateHttpAsLocalMedia 加载网络资源,
然后 拍照或则选择图片,在压缩模式下报错,非压缩不会报错
大概是把网络资源http图片拿去压缩的了,然后压缩失败

代码

        List<LocalMedia> list = new ArrayList<>();
        list.add(LocalMedia.generateHttpAsLocalMedia("https://wx2.sinaimg.cn/mw2000/0073ozWdly1h0afoipj8xj30kw3kmwru.jpg"));        

        mData.clear();
        mData.addAll(list);


PictureSelector.create(mContext)
                                        .openGallery(SelectMimeType.ofImage()) //照片 和视频  都可以选择
                                        .isWithSelectVideoImage(true)  //可以同时选择
                                        .setImageEngine(GlideEngine.createGlideEngine())  //
                                        .setMaxSelectNum(MAX_PIC_COUNT)  //最大数量
                                        .isMaxSelectEnabledMask(true)  //超过最大数量后 灰色
                                        .setSelectedData(mAdapter.getData())
                                        .setCompressEngine(new ImageFileCompressEngine())

报错日记

W/System.err: java.io.FileNotFoundException: /https:/wx2.sinaimg.cn/mw2000/0073ozWdly1h0afoipj8xj30kw3kmwru.jpg: open failed: ENOENT (No such file or directory)
        at libcore.io.IoBridge.open(IoBridge.java:575)
        at java.io.FileInputStream.<init>(FileInputStream.java:160)
W/System.err:     at java.io.FileInputStream.<init>(FileInputStream.java:115)
        at android.content.ContentResolver.openInputStream(ContentResolver.java:1516)
W/System.err:     at top.zibin.luban.io.ArrayPoolProvide.wrapInputStream(ArrayPoolProvide.java:108)
        at top.zibin.luban.io.ArrayPoolProvide.openInputStream(ArrayPoolProvide.java:65)
        at top.zibin.luban.Luban$Builder$3.openInternal(Luban.java:362)
        at top.zibin.luban.InputStreamAdapter.open(InputStreamAdapter.java:16)
W/System.err:     at top.zibin.luban.Checker.extSuffix(Checker.java:159)
        at top.zibin.luban.Luban.compressReal(Luban.java:203)
        at top.zibin.luban.Luban.compress(Luban.java:194)
        at top.zibin.luban.Luban.access$1000(Luban.java:23)
W/System.err:     at top.zibin.luban.Luban$1.run(Luban.java:146)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
W/System.err:     at java.lang.Thread.run(Thread.java:920)
W/System.err: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
        at libcore.io.Linux.open(Native Method)
W/System.err:     at libcore.io.ForwardingOs.open(ForwardingOs.java:567)
        at libcore.io.BlockGuardOs.open(BlockGuardOs.java:273)
        at libcore.io.ForwardingOs.open(ForwardingOs.java:567)
W/System.err:     at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7725)
        at libcore.io.IoBridge.open(IoBridge.java:561)
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

2 participants