X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fcom%2Fandroid%2Fmusic%2FMusicUtils.java;h=49bb7fedd603a0f03fdd4325e9222f840cd77c50;hb=756c3f57f11a7bb3bf1cf1333ee8ffbc51039748;hp=2f5aecac51438de68d5a26e447e9c97b3b9b455c;hpb=9d989c480204167cf983ba4dc3eac9dec5cddef9;p=android-x86%2Fpackages-apps-Music.git diff --git a/src/com/android/music/MusicUtils.java b/src/com/android/music/MusicUtils.java index 2f5aeca..49bb7fe 100644 --- a/src/com/android/music/MusicUtils.java +++ b/src/com/android/music/MusicUtils.java @@ -900,6 +900,16 @@ public class MusicUtils { // maybe it never existed to begin with. Bitmap bm = getArtworkFromFile(context, null, album_id); if (bm != null) { + if (bm.getConfig() == null) { + bm = bm.copy(Bitmap.Config.RGB_565, false); + if (bm == null) { + if (allowDefault) { + return getDefaultArtwork(context); + } else { + return null; + } + } + } // Put the newly found artwork in the database. // Note that this shouldn't be done for the "unknown" album, // but if this method is called correctly, that won't happen. @@ -910,16 +920,6 @@ public class MusicUtils { if (ensureFileExists(file)) { try { OutputStream outstream = new FileOutputStream(file); - if (bm.getConfig() == null) { - bm = bm.copy(Bitmap.Config.RGB_565, false); - if (bm == null) { - if (allowDefault) { - return getDefaultArtwork(context); - } else { - return null; - } - } - } boolean success = bm.compress(Bitmap.CompressFormat.JPEG, 75, outstream); outstream.close(); if (success) {