Hi when I try to get the album cover from a flac file using Taglib I get this error
Index was outside the bounds of the array.
Even though I know that the flac file contains an image. I'm using this code:
TagLib.File f = TagLib.File.Create(path);
if(f.Tag.Pictures.Length == 0) return;
var bin = (byte[])(f.Tag.Pictures[0].Data.Data);
songData.Cover = Image.FromStream(new MemoryStream(bin));
The code works with mp3 files but not with flac. So how do I get the album cover in c#?
Edit: I have found out that the code work with some flac files but not with all?