LuckSiege / LuckSiege/PictureSelector
低端机压缩5兆的图片必崩
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 13.6k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
## 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)
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the crash in the demo with a 5 MB tall image on a low-end Android device, then start at Engine.java:73 and follow the compression call chain through Luban.java:213 and Luban.java:194. Done means compression completes without the reported OutOfMemoryError under the described conditions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100