shaohui10086 / AdvancedLuban

An Advanced Compress Image Library for Android / 高效、简洁的图片压缩工具库
http://shaohui.me
Apache License 2.0
1.32k stars 192 forks source link

OOM了 #61

Open JsonWong87 opened 6 years ago

JsonWong87 commented 6 years ago

不断的循环压缩就出现OOM了 Luban.compress(this, filesLi).setCompressFormat(Bitmap.CompressFormat.JPEG).setMaxHeight(1920).setMaxWidth(1080).setMaxSize(500) .putGear(Luban.CUSTOM_GEAR) .asListObservable() .subscribe(new Consumer<List>() { @Override public void accept(List files) throws Exception { int size = files.size(); while (size-- > 0) { filesList.add(files.get(size)); if(size == 0) { uploadImg2(filesList);

                    }
                }
            }
        }, new Consumer<Throwable>() {
            @Override
            public void accept(Throwable throwable) throws Exception {
                throwable.printStackTrace();
                dialog.cancel();
            }
        });

java.lang.OutOfMemoryError: Failed to allocate a 24 byte allocation with 0 free bytes and 3GB until OOM