bumptech / bumptech/glide

SecurityException while loading image uri from photo picker

Open
#5,154 3 comments 3 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
35k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
8

Description

**Glide Version**: 4.15.1

**Integration libraries**: No

**Device/Android Version**: The issue is not specific to particular devices

**Issue details / Repro steps / Use case background**:
We are trying to use Glide to load images selected from photo picker but got the error below:
Load failed for [content://media/picker/0/com.android.providers.media.photopicker/media/1000000734] with dimensions [1440x2471]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 root cause:
java.lang.SecurityException(Calling uid ( 10118 ) does not have permission to access picker uri: content://media/picker/0/com.android.providers.media.photopicker/media/1000000734?requireOriginal=1)

However, we are able to access the image if we use MediaStore's getBitmap method with ContentResolver.

**Glide load line / `GlideModule` (if any) / list Adapter code (if any)**:
```java
Glide.with(context)
.load(imageUriFromPhotoPicker)
.into(findViewById(R.id.image_preview))
```

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.