bumptech / bumptech/glide

Support for ContentResolver.loadThumbnail when loading album artwork

Open
#4,066 4 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

**Glide Version**: 4.10.0

**Device/Android Version**: Nokia 7.1/Android 10 (Q)

**Issue details / Repro steps / Use case background**:
I am loading album artworks for tracks from the Android `MediaStore`. Before Android Q, I used the `Albums.ALBUM_ART` column to produce an `Uri` that Glide decoded successfully.
Since Android Q, that `Albums.ALBUM_ART` column is deprecated and always `null`, so the recommended way of loading album artworks is now to use [ContentResolver.loadThumbnail](https://developer.android.com/reference/android/content/ContentResolver.html#loadThumbnail(android.net.Uri,%20android.util.Size,%20android.os.CancellationSignal)), passing the `Uri` of the track or album.

Glide does not seem to support loading Bitmaps this way. Since I don't want to write a Bitmap cache and custom transformations (rounded corners) that Glide provides, how can I customize it to load those album artworks ?

Note: `ContentResolver.loadThumbnail` seems to delegate to `ContentResolver.loadTypedAssetFileDescriptor` under the hood.

**Glide load line / `GlideModule` (if any) / list Adapter code (if any)**:
```kotlin
Glide.with(fragment).load(albumMediaStoreUri).into(imageView)
```

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.