-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
De/Encoding for File URI image load problem #179
Comments
No, this is not the reason of problem. Actually I can't catch the problem in debug. |
Yes. the file exists... Another example: The value passing incoverPhotoFilePath:/storage/sdcard0/picasa_tool/google%252520plus-1.jpg Exception thrown by loader:03-01 09:40:21.880: E/ImageLoader(13598): /storage/sdcard0/picasa_tool/google%2520plus-1.jpg: open failed: ENOENT (No such file or directory) adb shell lsshell@android:/storage/sdcard0/picasa_tool $ ls goo* result"25" was removed by imageloader. |
Okay.. new File(URI uri) makes this happen.. |
I'll try ti fix it. |
Handled local files with encoded symbols in file name
Still having this issue even with your changes, I'm also on CM10 4.2.2 (Samsung Vibrant). |
Do you use snapshot jar? |
I always grab a zip and build the lib on my own. |
Show me please your config, display options and URI of file which you pass to |
//Config ImageLoader
DisplayImageOptions.Builder lBuilder = new DisplayImageOptions.Builder();
lBuilder.showStubImage(R.drawable.ic_launcher);
lBuilder.bitmapConfig(Integer.parseInt(mPrefs.getString(PrefsActivity.KEY_APP_BITMAP_TYPE, "0")) == 0 ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565);
if (mPrefs.getBoolean(
PrefsActivity.KEY_APP_MEMCACHE_ENABLED_PREFERENCE, true))
lBuilder.cacheInMemory();
if (mPrefs.getBoolean(
PrefsActivity.KEY_APP_DISCCACHE_ENABLED_PREFERENCE, true))
lBuilder.cacheOnDisc();
mDisplayOptions = lBuilder.build();
// Create configuration for ImageLoader
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
.discCache(new UnlimitedDiscCache(StorageHelper.getCacheDir()))
.threadPoolSize(5)
.threadPriority(Thread.NORM_PRIORITY-1)
.defaultDisplayImageOptions(mDisplayOptions)
.build(); // --
mImageLoader.init(config); String lCoverURL = "file:///"+ lCoverFile.getAbsolutePath(); URI = file:////storage/sdcard0/My Manga Reader/Naruto/cover.png 03-10 12:24:43.448: E/ImageLoader(5349): /storage/sdcard0/My%20Manga%20Reader/Cache/1526703973: open failed: ENOENT (No such file or directory)
03-10 12:24:43.448: E/ImageLoader(5349): java.io.FileNotFoundException: /storage/sdcard0/My%20Manga%20Reader/Cache/1526703973: open failed: ENOENT (No such file or directory)
03-10 12:24:43.448: E/ImageLoader(5349): at libcore.io.IoBridge.open(IoBridge.java:416)
03-10 12:24:43.448: E/ImageLoader(5349): at java.io.FileInputStream.<init>(FileInputStream.java:78)
03-10 12:24:43.448: E/ImageLoader(5349): at java.io.FileInputStream.<init>(FileInputStream.java:105)
03-10 12:24:43.448: E/ImageLoader(5349): at com.nostra13.universalimageloader.core.download.BaseImageDownloader.getStreamFromFile(BaseImageDownloader.java:141) |
Yes, I see the problem and I'll think about a solution. I guess At this moment I can recommend you to avoid using of spaces (" ") in your file paths. |
Thanks Sergey, I'll just use 1.8.0 for now, sorry for the trouble.
|
...). Not use URI class anywhere, use String class instead. Encode urls only for network downloads. Fixed bug for file URIs with special characters (#179). Improved Scheme enum, added Java docs.
Actually this isn't (fully) fixed. I'm using 1.9.3 and get the above error when loading images from sdcard from a directory containing whitespaces (%20). |
And what URI string do you pass into ImageLoader? |
/sdcard/Android/data/my.package/files/Pictures/directory%20containing%20whitespaces/some_image.jpg |
You should pass "/sdcard/Android/data/my.package/files/Pictures/directory containing whitespaces/some_image.jpg" |
Aight, that's why you changed it from Uri to String ... |
Replacing white space with %20 is working fine for me |
Replacing
|
For an image file: /storage/sdcard0/groupurchase/cache/http%3A%2F%2Fd2.lashouimg.com%2Fzt_mobile_220%2F201211%2F29%2F135417696321262100.jpg
imageLoader tries to load an decoded file path which is incorrect:
It should keep the encoded string as it is, and read by stream.
The problem is caused by imageloader code below:
The text was updated successfully, but these errors were encountered: