I see this is frequently asked and I have tried almost everything atleast once but I still can't get my code to work. My problem is, that when I try to set the Album art of a .mp3 file it doesn't set it and there are no errors what so ever. I have tried both .png and .jpg files and neither of them are working. The one thing I am sure is that the image path is the right one, because when I set the image path to the Image source on a WPF file it shows the image. I've also tried setting the MimeType to "image/png" (even jpg) and set the Type to FrontCover.
My code:
mp3File = TagLib.File.Create(path);
IPicture albumArt = new TagLib.Picture(imagePath);
mp3File.Tag.Pictures = new TagLib.IPicture[] { albumArt };
mp3File.Save();
If someone knows what I'm doing wrong or even know a better/another way to set the Album art, don't hesitate to awnser. Been working on this for the past 3 days now.
Thanks in advance.
EDIT: Somehow this works for only a select amount of mp3 files. I have a folder which contains all my .mp3 files and only for a select few .mp3 files it will change the album artist and the cover. The other .mp3 files only get a different album name, title and year, that's it.
EDIT V2: I found out, after setting the artist by hand (which I want to prevent) it will change the cover art and the AlbumArtist. But only then, not when it's unchanged by human hands so to say.;
Anyone got an idea of how to fix that?