issue loading image using facebook's Fresco image loading library when imagepath contains special chars like %

118 views Asked by At

I am using Fresco to load image in our app but in case where imagepath contains any special symbols or chars like % or #, it doesn't load image.

imagepath for my image is : /storage/emulated/0/Pictures/OGQ/Richard Walker_Stairway To Heaven%3F_YkFgR2RZ.jpg Fresco version: [1.5.0] https://github.com/facebook/fresco/issues/1972 Any heap appreciated!

1

There are 1 answers

0
Ujjwal On

convert imagepath to Uri as :

Uri picUri= Uri.fromFile(new File("/storage/emulated/0/Pictures/OGQ/Richard Walker_Stairway To Heaven%3F_YkFgR2RZ.jpg"

ImageRequest request=ImageRequestBuilder.newBuilderWithSource(picUri).setResizeOptions(new ResizeOptions(width, height)).build();

This will load image contains special chars or symbols.