aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/network/HtmlImage.java
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-04-24 14:03:03 +0200
committerSamuel Tardieu <sam@rfc1149.net>2014-04-24 14:05:06 +0200
commitd9c10378ffb456f2337739d1df316826913a2490 (patch)
tree4f80e8308bcdf00d7808997da1fc026c6c3b9ec8 /main/src/cgeo/geocaching/network/HtmlImage.java
parent34a31ce931c8e88f0e4e02897e910c42c4b14ae5 (diff)
downloadcgeo-d9c10378ffb456f2337739d1df316826913a2490.zip
cgeo-d9c10378ffb456f2337739d1df316826913a2490.tar.gz
cgeo-d9c10378ffb456f2337739d1df316826913a2490.tar.bz2
refactoring: add conversion utility methods between File and url
Diffstat (limited to 'main/src/cgeo/geocaching/network/HtmlImage.java')
-rw-r--r--main/src/cgeo/geocaching/network/HtmlImage.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/network/HtmlImage.java b/main/src/cgeo/geocaching/network/HtmlImage.java
index 36ce9c1..9c55fe9 100644
--- a/main/src/cgeo/geocaching/network/HtmlImage.java
+++ b/main/src/cgeo/geocaching/network/HtmlImage.java
@@ -135,11 +135,11 @@ public class HtmlImage implements Html.ImageGetter {
// Explicit local file URLs are loaded from the filesystem regardless of their age. The IO part is short
// enough to make the whole operation on the computation scheduler.
- if (url.startsWith("file://")) {
+ if (FileUtils.isFileUrl(url)) {
return Observable.defer(new Func0<Observable<? extends BitmapDrawable>>() {
@Override
public Observable<? extends BitmapDrawable> call() {
- final Bitmap bitmap = loadCachedImage(new File(url.substring(7)), true).getLeft();
+ final Bitmap bitmap = loadCachedImage(FileUtils.urlToFile(url), true).getLeft();
return bitmap != null ? Observable.from(ImageUtils.scaleBitmapToFitDisplay(bitmap)) : Observable.<BitmapDrawable>empty();
}
}).subscribeOn(RxUtils.computationScheduler);