Hello,
I am using TagLib # to read and write tags to mp3 files. Most of the data is very easy to read/write, but I am having trouble with the Album Art. I can get the Images from the file with no problem using the following code:

TagLib.File TagLibFile = TagLib.File.Create(strFilePath);
ImageConverter ic = new ImageConverter();
int iNumberOfPictures = TagLibFile.Tag.Pictures.Length;
Image[] images = new Image[iNumberOfPictures];

for (int i = 0; i < iNumberOfPictures; i++)
{
images[i] = (Image)ic.ConvertFrom(TagLibFile.Tag.Pictures[i].Data.Data);
}
return images;

I am also able to write an image back to the file with this code:

TagLib.File TagLibFile = TagLib.File.Create(strFilePath);
TagLib.Picture picture = TagLib.Picture.CreateFromPath("C:\\Pic.jpg");
TagLib.Id3v2.AttachedPictureFrame albumCoverPictFrame = new TagLib.Id3v2.AttachedPictureFrame(picture);
albumCoverPictFrame.MimeType = System.Net.Mime.MediaTypeNames.Image.Jpeg;
albumCoverPictFrame.Type = TagLib.PictureType.FrontCover;
TagLib.IPicture[] pictFrames = new IPicture[1];
pictFrames[0] = (IPicture)albumCoverPictFrame;
TagLibFile.Tag.Pictures = pictFrames;
TagLibFile.Save();

I would like to write the images to the file from an Image or byte[] instead of having to give TagLib a path. Is there a way to convert an Image (or byte[]) to an IPicture (opposite of the first code sample)? I was also trying to figure out the TagLib.Id3v2.AttachedPictureFrame(ByteVector data, byte version), but I wasn't sure if this is what I needed or how to use it. Thanks for your help!

Jen