facebook / facebook/fresco

Cannot load Adaptive Icons (ProgressiveDecoder: unknown image format)

Open
#2,173 5 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue starter-task
Dominant language
Kotlin
Stars
17.2k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

### Description

Trying to load the URI identifier for installed applications icons fails for some apps (system and non-system) and throws some logs:

> D/skia: --- SkAndroidCodec::NewFromStream returned null
> W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.sonymobile.synchub/2131427328, firstEncodedBytes: 03000800840100000100, length: 388}
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.google.android.calendar/2130903042, firstEncodedBytes: 03000800480200000100, length: 584}
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.android.chrome/2131231050, firstEncodedBytes: 03000800540100000100, length: 340}
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.sonyericsson.organizer/2130903043, firstEncodedBytes: 03000800C80100000100, length: 456}
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.google.android.apps.docs.editors.docs/2130838355, firstEncodedBytes: 030008008C0200000100, length: 652}
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.google.android.apps.docs/2130837900, firstEncodedBytes: 03000800280200000100, length: 552}
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.sonymobile.email/2130903040, firstEncodedBytes: 03000800280200000100, length: 552}
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://flar2.exkernelmanager/2131558401, firstEncodedBytes: 03000800F40100000100, length: 500}
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.google.android.inputmethod.latin/2130903043, firstEncodedBytes: 03000800280200000100, length: 552}
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.google.android.gm/2130903042, firstEncodedBytes: 03000800280200000100, length: 552}
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> D/skia: --- SkAndroidCodec::NewFromStream returned null
> W/unknown:ProgressiveDecoder: unknown image format, {uri: android.resource://com.google.android.googlequicksearchbox/2130903051, firstEncodedBytes: 03000800C80100000100, length: 456}

As seen in logs, it fails for applications like Chrome Browser, Docs, GMail, Google Calendar or even System keyboard

### Reproduction

Just retrieve ApplicationInfo to access ApplicationInfo.icon class field, then parse the URI for such icon identifier and try to load:

**LOADER**

`List appInfos = mPackageManager.getInstalledApplications(0);`

**LIST(RECYCLER)VIEW ADAPTER**
```
ApplicationInfo info = appInfos.get(position);
if (info.icon != 0) {
Uri uri = Uri.parse("android.resource://" + packageName + "/" + info.icon);
holder.appIconSimpleDraweeView.setImageURI(uri);
}
```

### Additional Information

* Fresco version: 1.10.0
* Platform version:

1. - Sony Xperia X Compact : Android Oreo 8.0.0
2. - Samsung Galaxy S8 : Android Oreo 8.0.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.