]> granicus.if.org Git - taglib/commitdiff
Parse covr atoms with type 0 (fixes issue #84)
authorLukáš Lalinský <lalinsky@gmail.com>
Sun, 11 Nov 2012 15:04:08 +0000 (16:04 +0100)
committerLukáš Lalinský <lalinsky@gmail.com>
Sun, 11 Nov 2012 15:04:08 +0000 (16:04 +0100)
taglib/mp4/mp4coverart.h
taglib/mp4/mp4tag.cpp

index 804ab7852194df7e29d9efc9415fef171fcb8c80..64115b458ed8fafcb9c0adfb6e37783b0d96ea5b 100644 (file)
@@ -42,10 +42,11 @@ namespace TagLib {
        * This describes the image type.
        */
       enum Format {
-        JPEG = TypeJPEG,
-        PNG  = TypePNG,
-        BMP  = TypeBMP,
-        GIF  = TypeGIF
+        JPEG    = TypeJPEG,
+        PNG     = TypePNG,
+        BMP     = TypeBMP,
+        GIF     = TypeGIF,
+        Unknown = TypeImplicit,
       };
 
       CoverArt(Format format, const ByteVector &data);
index f929ef64049f8b9181a0510be2b29630d0765548..afecf98ad5f99c793cea813392f36ca4816d6666 100644 (file)
@@ -283,10 +283,13 @@ MP4::Tag::parseCovr(MP4::Atom *atom, TagLib::File *file)
       debug("MP4: Unexpected atom \"" + name + "\", expecting \"data\"");
       break;
     }
-    if(flags == TypeJPEG || flags == TypePNG || flags == TypeBMP || flags == TypeGIF) {
+    if(flags == TypeJPEG || flags == TypePNG || flags == TypeBMP || flags == TypeGIF || flags == TypeImplicit) {
       value.append(MP4::CoverArt(MP4::CoverArt::Format(flags),
                                  data.mid(pos + 16, length - 16)));
     }
+    else {
+      debug("MP4: Unknown covr format " + String::number(flags));
+    }
     pos += length;
   }
   if(value.size() > 0)