From f06a603621a4ff672e760a698a75f15d28da6c75 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C3=ABl=20Carr=C3=A9?= Date: Wed, 3 Oct 2007 21:07:01 +0000 Subject: [PATCH] taglib: warn the user when the embedded image is invalid (i.e. was embedded by a broken version of iTunes) --- modules/meta_engine/taglib.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp index 894f171dc3..eb421349c9 100644 --- a/modules/meta_engine/taglib.cpp +++ b/modules/meta_engine/taglib.cpp @@ -119,6 +119,18 @@ static void DetectImage( FileRef f, demux_t *p_demux ) ByteVector p_data_taglib; const char *p_data; int i_data; psz_mime = p_apic->mimeType().toCString(true); + + /* some old iTunes version not only sets incorrectly the mime type + * but also embeds incorrectly the image. + * Recent versions seem to behave correctly */ + if( !strncmp( psz_mime, "PNG", 3 ) ) + { + msg_Warn( p_demux, + "%s: Invalid picture embedded by broken iTunes version", + f.file()->name() ); + break; + } + psz_description = p_apic->description().toCString(true); psz_name = psz_description; -- 2.39.2