[prev in list] [next in list] [prev in thread] [next in thread] 

List:       taglib-devel
Subject:    Re: Cover of flac file
From:       grisha <grish.vanika () gmail ! com>
Date:       2012-10-23 22:08:01
Message-ID: loom.20121024T000642-43 () post ! gmane ! org
[Download RAW message or body]

Lukáš Lalinský <lalinsky <at> gmail.com> writes:

 Well, it's exactly the reverse process.
 
 You know that the image is in the Vorbis Comment under the name
 "METADATA_BLOCK_PICTURE", so you need to get that field. The field is
 encoded using base64, so you need to decide it to binary data. Once
 you have the binary data, you pass it to the TagLib::FLAC::Picture
 constructor.
 
 TagLib::Ogg::XiphComment *tag = file.xiphComment();
 if (tag->contains(""METADATA_BLOCK_PICTURE"")) {
   TagLib::String encodedData =
 tag->fieldListMap()["METADATA_BLOCK_PICTURE"].front();
   TagLib::ByteVector data = someBase64DecodeFunction(encodedData);
   TagLib::FLAC::Picture *picture = new TagLib::FLAC::Picture(data);
   // do something with the picture
 }
 
 Lukas
 


Thanks.


_______________________________________________
taglib-devel mailing list
taglib-devel@kde.org
https://mail.kde.org/mailman/listinfo/taglib-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic