fresco icon indicating copy to clipboard operation
fresco copied to clipboard

Cant load a local image, the file's name has percent-encoding string

Open s1rius opened this issue 11 years ago • 1 comments

Fresco 0.6.0 Android 5.1

file name

https%3A%2F%2F41.media.tumblr.com%2Ff78cac2b19b09e8923c26b8f0c78b7fa%2Ftumblr_n705ejCvHO1rq3e41o1_1280.jpg

log

E/JHEAD﹕ can't open '/storage/emulated/0/Tumblr/https:/41.media.tumblr.com/f78cac2b19b09e8923c26b8f0c78b7fa/tumblr_n705ejCvHO1rq3e41o1_1280.jpg'

It works when I change the file name to a normal string. Help

s1rius avatar Jul 23 '15 09:07 s1rius

I create a new ImageRequest and override the getSouceFile() function to resolve the encode problem.

    @Override
    public synchronized File getSourceFile() {
        File file = super.getSourceFile();
        if (file == null || !file.exists()) {
            file = new File(getSourceUri().getEncodedPath());
        }
        return file;
    }

s1rius avatar Jul 24 '15 09:07 s1rius