From 0b9a2df3ecc1648f788eae97894a0176757a0136 Mon Sep 17 00:00:00 2001 From: Alberto Fustinoni Date: Mon, 28 Nov 2016 16:24:22 +0900 Subject: [PATCH 1/4] Fixed incorrect handling of wstring mime types when setting pictures --- taglib/mp4/mp4tag.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/taglib/mp4/mp4tag.cpp b/taglib/mp4/mp4tag.cpp index 94582ecb..9493ae26 100644 --- a/taglib/mp4/mp4tag.cpp +++ b/taglib/mp4/mp4tag.cpp @@ -835,16 +835,16 @@ MP4::Tag::setPictures(const PictureMap &l) ++pictureListIt) { Picture picture = *pictureListIt; CoverArt::Format format; - const char *mime = picture.mime().toCString(); - if(std::strcmp("image/", mime) == 0) + String mime = picture.mime(); + if(String("image/") == mime) format = CoverArt::Unknown; - else if(std::strcmp("image/bmp", mime) == 0) + else if(String("image/bmp") == mime) format = CoverArt::BMP; - else if(std::strcmp("image/png", mime) == 0) + else if(String("image/png") == mime) format = CoverArt::PNG; - else if(std::strcmp("image/gif", mime) == 0) + else if(String("image/gif") == mime) format = CoverArt::GIF; - else if(std::strcmp("image/jpeg", mime) == 0) + else if(String("image/jpeg") == mime) format = CoverArt::JPEG; else format = CoverArt::Unknown; From e77e20597d080f4d856d1943c074e4a1c5355fc6 Mon Sep 17 00:00:00 2001 From: Alberto Fustinoni Date: Mon, 28 Nov 2016 16:30:24 +0900 Subject: [PATCH 2/4] Nothing in this file requires config.h directives, and it causes compilation to fail when not using one (HAVE_CONFIG_H not set) --- taglib/mp4/mp4item.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/taglib/mp4/mp4item.cpp b/taglib/mp4/mp4item.cpp index e5f842ef..cb3b5934 100644 --- a/taglib/mp4/mp4item.cpp +++ b/taglib/mp4/mp4item.cpp @@ -23,8 +23,6 @@ * http://www.mozilla.org/MPL/ * ***************************************************************************/ -#include "config.h" - #include "taglib.h" #include "tdebug.h" #include "tsmartptr.h" From e188a39b5c8584ed22a2245d4707ded840abda75 Mon Sep 17 00:00:00 2001 From: Alberto Fustinoni Date: Mon, 28 Nov 2016 16:33:21 +0900 Subject: [PATCH 3/4] Spacing --- taglib/mp4/mp4tag.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taglib/mp4/mp4tag.cpp b/taglib/mp4/mp4tag.cpp index 9493ae26..99dbcd90 100644 --- a/taglib/mp4/mp4tag.cpp +++ b/taglib/mp4/mp4tag.cpp @@ -835,7 +835,7 @@ MP4::Tag::setPictures(const PictureMap &l) ++pictureListIt) { Picture picture = *pictureListIt; CoverArt::Format format; - String mime = picture.mime(); + String mime = picture.mime(); if(String("image/") == mime) format = CoverArt::Unknown; else if(String("image/bmp") == mime) From 6a2e276767d05aa0ba0ed5bc912ba7c13d73be87 Mon Sep 17 00:00:00 2001 From: Alberto Fustinoni Date: Mon, 28 Nov 2016 16:34:01 +0900 Subject: [PATCH 4/4] Formatting --- taglib/mp4/mp4tag.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taglib/mp4/mp4tag.cpp b/taglib/mp4/mp4tag.cpp index 99dbcd90..99251675 100644 --- a/taglib/mp4/mp4tag.cpp +++ b/taglib/mp4/mp4tag.cpp @@ -835,7 +835,7 @@ MP4::Tag::setPictures(const PictureMap &l) ++pictureListIt) { Picture picture = *pictureListIt; CoverArt::Format format; - String mime = picture.mime(); + String mime = picture.mime(); if(String("image/") == mime) format = CoverArt::Unknown; else if(String("image/bmp") == mime)