Explorer MP3 thumbnail not updating when saved with TagLib#

564 views Asked by At

I am using TagLib# to edit some MP3 tags. To set the album art for the track, I use the following simple line:

file.Tag.Pictures = new TagLib.IPicture[] { new TagLib.Picture(filepath) };

It works and sets the image as expected. When I save the file, close the program and load up the file again, I correctly see the image I assigned. Clearly, it wrote the image to the file.

But when I look at the file in Windows Explorer, it does not show the correct icon I set, instead showing the default one. Only when I re-save the file in Tagscan does the icon update, and then modifying the image from my program begins changing the icon to match what was saved.

What is the issue here? How can I allow my image changes to be shown as a thumbnail without having to use another program?

Thanks!

EDIT: Here's some more information discovered along the way. I saved an image in a plain MP3 and looked at it in Notepad, then re-saved the file with Tagscan and took another look to see what changed. Here's the data I found.

  • No image, untouched:

ID3 TXXX major_brand isom TXXX minor_version 512 TXXX compatible_brands isomiso2mp41 TSSE Lavf57.51.102 TIT2 test nameTALB test albumTPE2 test artistTCOM test artistTPE1 test artistPRIV SampleStart 0 0 : 0 0 : 0 0

  • Image added with my program:

ID3 TXXX major_brand isom TXXX minor_version 512 TXXX compatible_brands isomiso2mp41 TSSE Lavf57.51.102 TIT2 test nameTALB test albumTPE2 test artistTCOM test artistTPE1 test artistPRIV SampleStart 0 0 : 0 0 : 0 0 APIC Q image/png ‰PNG IHDR óÿa ‹IDATxœcÀ0¹õ¿yz÷ëÜ~8‰°jxõ‚ø7.ÿŸ;ÿðÿØþÍÿ£{7ÿÏž{ŒAâ¦é½Ä Ò3 †Aâæ™D ²=°y%ŠÈ® h H¡¤{&Ã4ÂøD RÓhœØÆ0~ëj€ÁlDÇD¹ d ÌFd'Ê# 1šY¬Œß IEND®B‚

  • File with image re-saved with Tagscan:

ID3 TXXX major_brand isom TXXX minor_version 512 TXXX compatible_brands isomiso2mp41 TSSE Lavf57.51.102 TIT2 TXXX % ÿþm a j o r _ b r a n d ÿþi s o m TXXX ' ÿþm i n o r _ v e r s i o n ÿþ5 1 2 TXXX A ÿþc o m p a t i b l e _ b r a n d s ÿþi s o m i s o 2 m p 4 1 TSSE ÿþL a v f 5 7 . 5 1 . 1 0 2 TIT2 ÿþt e s t n a m e TALB ÿþt e s t a l b u m TPE2 ÿþt e s t a r t i s t TCOM ÿþt e s t a r t i s t TPE1 ÿþt e s t a r t i s t PRIV SampleStart 0 0 : 0 0 : 0 0 APIC Ñ image/png ‰PNG IHDR óÿa ‹IDATxœcÀ0¹õ¿yz÷ëÜ~8‰°jxõ‚ø7.ÿŸ;ÿðÿØþÍÿ£{7ÿÏž{ŒAâ¦é½Ä Ò3 †Aâæ™D ²=°y%ŠÈ® h H¡¤{&Ã4ÂøD RÓhœØÆ0~ëj€ÁlDÇD¹ d ÌFd'Ê# 1šY¬Œß IEND®B‚

The only noticeable change is that everything got... spaced out. I realize poking through the song data in Notepad of all things probably isn't the best way to find information, but it's the best I've got.

1

There are 1 answers

0
Fᴀʀʜᴀɴ Aɴᴀᴍ On BEST ANSWER

Make sure you save with ID3 version <= 2.3. Windows Explorer shows the default file icon associated with the .mp3 extension for 2.4 tags.

ID3v2.4, though being around for a while now, is not really the most compatible version of ID3 to use. Windows Explorer and Groove Music alike don't recognize tags saved with that version. I think Google Play Music too has this issue.

So, your safest bet would be to store tags using ID3v2.3.