Ignore warnings from coders when loading cover images. fixes #48

This commit is contained in:
emeric
2020-04-10 16:40:58 +02:00
parent e17b2333ac
commit 8d8d778e47
+18
View File
@@ -63,6 +63,15 @@ Image::load(const std::vector<unsigned char>& rawData)
return true;
}
catch (Magick::WarningCoder& e)
{
return true;
}
catch (Magick::Warning& e)
{
LMS_LOG(COVER, WARNING) << "Caught Magick warning while loading raw image: " << e.what();
return false;
}
catch (Magick::Exception& e)
{
LMS_LOG(COVER, ERROR) << "Caught Magick exception while loading raw image: " << e.what();
@@ -79,6 +88,15 @@ Image::load(const std::filesystem::path& p)
return true;
}
catch (Magick::WarningCoder& e)
{
return true;
}
catch (Magick::Warning& e)
{
LMS_LOG(COVER, WARNING) << "Caught Magick warning while loading raw image: " << e.what();
return false;
}
catch (Magick::Exception& e)
{
LMS_LOG(COVER, ERROR) << "Caught Magick exception while loading image from file '" << p.string() << "': " << e.what();