From: Sander Jansen Date: Sun, 17 May 2015 03:34:08 +0000 (-0500) Subject: Support reading deprecated COVERART xiphcomment X-Git-Tag: v1.11beta~64^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41a44f4ab2b1dda149e54c9b7431dd8624d22c51;p=taglib Support reading deprecated COVERART xiphcomment --- diff --git a/taglib/ogg/xiphcomment.cpp b/taglib/ogg/xiphcomment.cpp index cb607ce4..0424ed55 100644 --- a/taglib/ogg/xiphcomment.cpp +++ b/taglib/ogg/xiphcomment.cpp @@ -434,6 +434,23 @@ void Ogg::XiphComment::parse(const ByteVector &data) else debug("Unable to parse METADATA_BLOCK_PICTURE. Discarding content."); } + else if (entry.startsWith("COVERART=")) { + + // Decode base64 picture data + ByteVector picturedata = ByteVector::fromBase64(entry.mid(9)); + + if (picturedata.size() == 0) { + debug("Empty coverart data. Discaring content"); + continue; + } + + // Assume it's some type of image file + FLAC::Picture * picture = new FLAC::Picture(); + picture->setData(picturedata); + picture->setMimeType("image/"); + picture->setType(FLAC::Picture::Other); + d->pictureList.append(picture); + } else { // Check for field separator