From eeed6bb7cb1c5484372ad1ee3bee70531c47cbde Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 25 Mar 2013 20:22:13 -0700 Subject: In offline mode, don't just assume the album art exists --- .../daneren2005/dsub/service/OfflineMusicService.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'subsonic-android/src') diff --git a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java index 4fbbaf2d..5f9aaf96 100644 --- a/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java +++ b/subsonic-android/src/github/daneren2005/dsub/service/OfflineMusicService.java @@ -179,14 +179,11 @@ public class OfflineMusicService extends RESTMusicService { @Override public Bitmap getCoverArt(Context context, MusicDirectory.Entry entry, int size, int saveSize, ProgressListener progressListener) throws Exception { - InputStream in = new FileInputStream(entry.getCoverArt()); - try { - byte[] bytes = Util.toByteArray(in); - Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.length); - return Bitmap.createScaledBitmap(bitmap, size, size, true); - } finally { - Util.close(in); - } + try { + return FileUtil.getAlbumArtBitmap(context, entry, size); + } catch(Exception e) { + return null; + } } @Override -- cgit v1.2.3