Skip to content

Commit

Permalink
Support file schemes in SimpleBitmapLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
tzugen authored Jul 6, 2022
1 parent 2c72010 commit 6016418
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ private static Bitmap decode(byte[] data) {
}

private static Bitmap load(Uri uri) throws IOException {
if (uri.getScheme().equals("file")) {
return BitmapFactory.decodeFile(uri.getPath());
}
URLConnection connection = new URL(uri.toString()).openConnection();
if (!(connection instanceof HttpURLConnection)) {
throw new UnsupportedOperationException("Unsupported scheme: " + uri.getScheme());
Expand Down

0 comments on commit 6016418

Please sign in to comment.