Index: apps/metadata/asf.c =================================================================== --- apps/metadata/asf.c (Revision 30259) +++ apps/metadata/asf.c (Arbeitskopie) @@ -462,6 +462,36 @@ } else if (!strcmp("MusicBrainz/Track Id", utf8buf)) { id3->mb_track_id = id3buf; asf_utf16LEdecode(fd, length, &id3buf, &id3buf_remaining); +#ifdef HAVE_ALBUMART + } else if (!strcmp("WM/Picture", utf8buf)) { + /* Reset utf8 buffer */ + utf8 = utf8buf; + utf8length = 512; +#if 1 + /* Gather the album art format. */ + lseek(fd, 5, SEEK_CUR); /* Jump 5 bytes of unknown data. */ + asf_utf16LEdecode(fd, 24, &utf8, &utf8length); /* Read 24 bytes image format. */ + if (!strcmp("image/jpeg", utf8buf)) { + printf("embedded jpg\n"); + id3->albumart.type = AA_TYPE_JPG; + } else { + printf("embedded unknown\n"); + id3->albumart.type = AA_TYPE_UNKNOWN; + } +#else + lseek(fd, 29, SEEK_CUR); + id3->albumart.type = AA_TYPE_JPG; +#endif + /* Set the album art size and position. */ + if (id3->albumart.type != AA_TYPE_UNKNOWN) + { + id3->albumart.pos = lseek(fd, 0, SEEK_CUR); + id3->albumart.size = length - (5 + 24); + id3->embed_albumart = true; + } + + lseek(fd, length - 29, SEEK_CUR); +#endif } else { lseek(fd, length, SEEK_CUR); }