-1

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!

Ujjwal
  • 346
  • 4
  • 11
  • Not sure about Fresco , cant you go with glide ? https://github.com/bumptech/glide – Sreehari Nov 24 '17 at 06:07
  • @Stallion we have shifted from glide to fresco and finding it better in terms of memory management, performance, and image loading experience. Glide had the same issue as well https://github.com/bumptech/glide/issues/867 but its fixed and i tried the same with fresco, its working...so the solution is load(Uri.fromFile(new File(...)) ..thanks – Ujjwal Nov 24 '17 at 06:26
  • https://androidcreativity.wordpress.com/2017/04/22/compare-image-library/ – Sreehari Nov 24 '17 at 06:59

1 Answers1

0

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.

Ujjwal
  • 346
  • 4
  • 11