fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Incorrect Uri scheme for local app assets

Open davidschreiber opened this issue 11 years ago • 2 comments

Android assets may be accessed using an Uri of this format file:///android_asset/... but Fresco uses the asset://... scheme which leads to incompatibility with other solutions.

E.g. when switching using Square's Picasso with Fresco, all Uris need to be changed to work with Fresco.

davidschreiber avatar Mar 30 '15 09:03 davidschreiber

file:///android_asset is only for use with WebView. For example, Universal Image Loader uses assets://image.png. So, I'm afraid there is no standard convention here. The fact that FileInputStream cannot open /android_asset/... is enough to disqualify the file scheme from being used for this purpose.

plamenko avatar Mar 30 '15 15:03 plamenko

Fresco should support file:///android_asset/ instead of creating new scheme and don't documented clearly that asset:// scheme is vendor specific.

Picasso: https://github.com/square/picasso/issues/332 Glide: http://stackoverflow.com/questions/29982341/using-glide-for-android-how-do-i-load-images-from-asset-and-resources

anotherdev avatar Nov 23 '15 10:11 anotherdev