LuckSiege / PictureSelector

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

低端机压缩5兆的图片必崩 #2564

Open LxzBUG opened 1 year ago

LxzBUG commented 1 year ago

Current use version?

当前使用的版本是多少?

demo 最新版

Will this problem occur in demo?

Demo能否复现这问题?

Describe the problem or provide an error log?

描述问题或提供错误log?

低端手机,压缩一个5mb大小的长图,必崩溃
 java.lang.OutOfMemoryError: Failed to allocate a 208929252 byte allocation with 16777216 free bytes and 161MB until OOM
        at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
        at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
        at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:650)
        at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:626)
        at top.zibin.luban.Engine.compress(Engine.java:73)
        at top.zibin.luban.Luban.compressReal(Luban.java:213)
        at top.zibin.luban.Luban.compress(Luban.java:194)
        at top.zibin.luban.Luban.access$1000(Luban.java:23)
        at top.zibin.luban.Luban$1.run(Luban.java:146)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:760)
Mc-dashan commented 1 year ago

有解决办法吗