X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/8fab264a05c7d7beb46bd2ae9e54bef7eb96f21d..366ec0b4723d6735fed5ed3e7dab6f1b7a0a4a61:/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java diff --git a/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java b/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java index 8a6971e8..5806a408 100644 --- a/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java +++ b/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java @@ -55,6 +55,7 @@ import com.owncloud.android.lib.resources.status.OwnCloudVersion; import com.owncloud.android.ui.adapter.DiskLruImageCache; import com.owncloud.android.utils.BitmapUtils; import com.owncloud.android.utils.DisplayUtils; +import com.owncloud.android.utils.FileStorageUtils; /** * Manager for concurrent access to thumbnails cache. @@ -188,8 +189,7 @@ public class ThumbnailsCacheManager { thumbnail = doFileInBackground(); String url = ((File) mFile).getAbsolutePath(); - FileNameMap fileNameMap = URLConnection.getFileNameMap(); - String mMimeType = fileNameMap.getContentTypeFor("file://" + url); + String mMimeType = FileStorageUtils.getMimeTypeFromName(url); if (mMimeType != null && mMimeType.startsWith("video/")){ thumbnail = addVideoOverlay(thumbnail); @@ -400,8 +400,12 @@ public class ThumbnailsCacheManager { int x3 = 0; int y3 = 0; - double ym = ( ((Math.pow(x3,2) - Math.pow(x1,2) + Math.pow(y3,2) - Math.pow(y1,2)) * (x2 - x1)) - (Math.pow(x2,2) - Math.pow(x1,2) + Math.pow(y2,2) - Math.pow(y1,2)) * (x3 - x1) ) / (2 * ( ((y3 - y1) * (x2 - x1)) - ((y2 - y1) * (x3 - x1)) )); - double xm = ( (Math.pow(x2,2) - Math.pow(x1,2)) + (Math.pow(y2,2) - Math.pow(y1,2)) - (2*ym*(y2 - y1)) ) / (2*(x2 - x1)); + double ym = ( ((Math.pow(x3,2) - Math.pow(x1,2) + Math.pow(y3,2) - Math.pow(y1,2)) * + (x2 - x1)) - (Math.pow(x2,2) - Math.pow(x1,2) + Math.pow(y2,2) - + Math.pow(y1,2)) * (x3 - x1) ) / (2 * ( ((y3 - y1) * (x2 - x1)) - + ((y2 - y1) * (x3 - x1)) )); + double xm = ( (Math.pow(x2,2) - Math.pow(x1,2)) + (Math.pow(y2,2) - Math.pow(y1,2)) - + (2*ym*(y2 - y1)) ) / (2*(x2 - x1)); // offset to top left double ox = - xm;