From 3a5aeb457324f9dcac2c0051e94b0d748af63f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Sun, 11 Nov 2012 16:04:08 +0100 Subject: [PATCH] Parse covr atoms with type 0 (fixes issue #84) --- taglib/mp4/mp4coverart.h | 9 +++++---- taglib/mp4/mp4tag.cpp | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/taglib/mp4/mp4coverart.h b/taglib/mp4/mp4coverart.h index 804ab785..64115b45 100644 --- a/taglib/mp4/mp4coverart.h +++ b/taglib/mp4/mp4coverart.h @@ -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); diff --git a/taglib/mp4/mp4tag.cpp b/taglib/mp4/mp4tag.cpp index f929ef64..afecf98a 100644 --- a/taglib/mp4/mp4tag.cpp +++ b/taglib/mp4/mp4tag.cpp @@ -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)