Switching from ImageMagick++ to GraphicsMagick++ to ease compatibility with wt4. ref #42

This commit is contained in:
emeric
2020-03-28 20:09:57 +01:00
parent bd6a08facb
commit 2c9952b8b7
6 changed files with 11 additions and 22 deletions
+6 -8
View File
@@ -49,15 +49,13 @@ Grabber::Grabber(const std::filesystem::path& execPath)
init(execPath);
}
Grabber::~Grabber()
{
deinit();
}
void
Grabber::setDefaultCover(const std::filesystem::path& p)
{
if (!_defaultCover.load(p))
std::unique_lock lock {_mutex};
_defaultCover = std::make_unique<Image>();
if (!_defaultCover->load(p))
throw LmsException("Cannot read default cover file '" + p.string() + "'");
}
@@ -65,12 +63,12 @@ Image
Grabber::getDefaultCover(std::size_t size)
{
LMS_LOG(COVER, DEBUG) << "Getting a default cover using size = " << size;
std::unique_lock<std::mutex> lock(_mutex);
std::unique_lock lock {_mutex};
auto it = _defaultCovers.find(size);
if (it == _defaultCovers.end())
{
Image cover = _defaultCover;
Image cover = *_defaultCover;
LMS_LOG(COVER, DEBUG) << "default cover size = " << cover.getSize().width << " x " << cover.getSize().height;