X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/bdb959f2e217c9c0bc28e0c1ba55bf6fb6f632b1..6d5c6f86e5fa9a2edb51562d028554cbc49cdf93:/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java?ds=inline diff --git a/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java b/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java index edab29d4..eeb01829 100644 --- a/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java +++ b/src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java @@ -173,6 +173,25 @@ public class ThumbnailsCacheManager { } mFile = params[0]; + final String imageKey = String.valueOf(mFile.getRemoteId()); + + // Check disk cache in background thread + thumbnail = getBitmapFromDiskCache(imageKey); + + // Not found in disk cache + if (thumbnail == null || mFile.needsUpdateThumbnail()) { + // Use Width of imageView -> no blurry images on big screens + int px = mImageViewReference.get().getWidth(); + + if (mFile.isDown()){ + Bitmap bitmap = BitmapUtils.decodeSampledBitmapFromFile( + mFile.getStoragePath(), px, px); + + if (bitmap != null) { + thumbnail = ThumbnailUtils.extractThumbnail(bitmap, px, px); + + // Add thumbnail to cache + addBitmapToCache(imageKey, thumbnail); if (mFile instanceof OCFile) { thumbnail = doOCFileInBackground();