Android album art thumbnails problem: resolveUri failed on bad bitmap uri
<p>I am trying to display a list of albums (of music mp3s stored on the sd-card) along with the album art for each album. The album art is stored in the mp3s tag (it is not a separate image on the SD card)</p>

<p>I can get the album details fine using:</p>

<pre><code>String[] projection = new String[] { Albums._ID, Albums.ALBUM, Albums.ARTIST, Albums.ALBUM_ART, Albums.NUMBER_OF_SONGS };
        String rowsToReturn = null;
        String[] selectionWhere = null;
        String sortOrder = Media.ALBUM + " ASC";

        Cursor cursor = contentResolver.query(Albums.EXTERNAL_CONTENT_URI, projection, rowsToReturn, selectionWhere, sortOrder);

        String albumArtUri = cursor.getString(cursor.getColumnIndex(Albums.ALBUM_ART));
</code></pre>

<p>The URI is correct, but when I try to set the URi to the src of an ImageView, I get a silent error being thrown "resolveUri failed on bad bitmap uri".</p>

<pre><code>imageview.setImageURI(Uri.parse(albumArtUri));
</code></pre>

<p>This only happens for some albums. Some are fine and display the album art correctly.
I took a look at the URI path and checked on the SD card for the thumbnail images and found them here: /mnt/sdcard/Android/data/com.android.providers.media/albumthumbs/</p>

<p>I found images that work and images that dont, so the image does exist, but just cannot be read correctly. I even tried copying the images off the sd card and adding .png extension to the files - the ones that show up on the phone work, but the ones that don't are 'corrupt'</p>

<p>Finally I copied the mp3 files themselves back to the PC and inspected the album art embedded in the tags and they all show correctly.</p>

<p>It's almost as if the thumbnails that the Android system is creating form the tags are invalid or corrupt, but this can't be right.</p>

<p>Or maybe I need to read them differently?</p>
