LuckSiege / LuckSiege/PictureSelector

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

Open
#2,564 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.