LuckSiege / LuckSiege/PictureSelector
图片选择问题
- Dominant language
- Java
- Stars
- 13.6k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
## Current use version?
#### 当前使用的版本是多少?
3.0.9 华为p30鸿蒙2.0
```
```
## Will this problem occur in demo?
#### Demo能否复现这问题?
能,一旦出现第一次就会频发
```
```
## Describe the problem or provide an error log?
#### 描述问题或提供错误log?
反复选择图片情况下
PictureFileUtils.createFilePath(ctx, "", mineType, customFileName);和PictureContentResolver.getContentResolverOpenInputStream(ctx, Uri.parse(url));偶尔会执行缓慢,大概1-2分钟,但是能执行成功
public static String copyPathToSandbox(Context ctx, String url, String mineType, String customFileName) {
try {
InputStream inputStream;
String sandboxPath = PictureFileUtils.createFilePath(ctx, "", mineType, customFileName);
if (PictureMimeType.isContent(url)) {
inputStream = PictureContentResolver.getContentResolverOpenInputStream(ctx, Uri.parse(url));
} else {
inputStream = new FileInputStream(url);
}
boolean copyFileSuccess = PictureFileUtils.writeFileFromIS(inputStream, new FileOutputStream(sandboxPath));
if (copyFileSuccess) {
return sandboxPath;
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
```
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing copyPathToSandbox and the calls to PictureFileUtils.createFilePath and PictureContentResolver.getContentResolverOpenInputStream. Reproduce repeated image selection on the reported Huawei P30/HarmonyOS 2.0 setup and measure where the 1–2 minute delay occurs. Done means the delay is explained and the affected image-selection path no longer stalls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100