]> granicus.if.org Git - taglib/commitdiff
Support reading deprecated COVERART xiphcomment
authorSander Jansen <s.jansen@gmail.com>
Sun, 17 May 2015 03:34:08 +0000 (22:34 -0500)
committerSander Jansen <s.jansen@gmail.com>
Thu, 12 Nov 2015 14:50:34 +0000 (08:50 -0600)
taglib/ogg/xiphcomment.cpp

index cb607ce423b837adede3f5318da56edcc7e7e97f..0424ed5582ffdb74f785dfde4a9a98f9b998479e 100644 (file)
@@ -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