diff options
Diffstat (limited to 'src/de/danoeh/antennapod/asynctask/FeedImageLoader.java')
-rw-r--r-- | src/de/danoeh/antennapod/asynctask/FeedImageLoader.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/de/danoeh/antennapod/asynctask/FeedImageLoader.java b/src/de/danoeh/antennapod/asynctask/FeedImageLoader.java index 02a2ebf60..2c520a3ae 100644 --- a/src/de/danoeh/antennapod/asynctask/FeedImageLoader.java +++ b/src/de/danoeh/antennapod/asynctask/FeedImageLoader.java @@ -162,10 +162,16 @@ public class FeedImageLoader { decodedBitmap = BitmapFactory.decodeFile(params[0] .getFile_url()); } + if (decodedBitmap != null) { bitmap = Bitmap.createScaledBitmap(decodedBitmap, PREFERRED_LENGTH, PREFERRED_LENGTH, false); - + addBitmapToCache(params[0].getId(), bitmap); + } else { + Log.w(TAG, "Could not load bitmap. Using default image."); + bitmap = BitmapFactory.decodeResource(target.getResources(), + R.drawable.default_cover); + } if (AppConfig.DEBUG) Log.d(TAG, "Finished loading bitmaps"); } else { Log.e(TAG, |