Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading files via URI string fails #52

Closed
saschpe opened this issue Aug 20, 2019 · 1 comment
Closed

Loading files via URI string fails #52

saschpe opened this issue Aug 20, 2019 · 1 comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@saschpe
Copy link

saschpe commented Aug 20, 2019

Is your feature request related to a problem? Please describe.
ImageView.load("file:///data/user/0/foo/cache/1.jpg") fails with

 java.lang.IllegalArgumentException: Expected URL scheme 'http' or 'https' but was 'file'
        at okhttp3.HttpUrl$Builder.parse(HttpUrl.java:1328)

because it is directly handed down to OkHttp3.

Describe the solution you'd like
A check if the Uri starts with *file:// could map to load(file: File) instead.

@saschpe saschpe added the enhancement New feature or request label Aug 20, 2019
@colinrtwhite
Copy link
Member

Tracking support for this here: #24

The current workaround is to use ImageView.load(Uri.parse("file:///data/user/0/foo/cache/1.jpg")). The fix for this will likely make it into 0.7.0.

@colinrtwhite colinrtwhite added the duplicate This issue or pull request already exists label Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants