summaryrefslogtreecommitdiffstats
path: root/src/library/coverart.cpp
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2020-06-01 16:27:21 +0200
committerUwe Klotz <uklotz@mixxx.org>2020-06-05 13:25:18 +0200
commitf6ba1d4b676dfce45b691be6f1a6a282d982a6ab (patch)
tree30a72e491247a95d59f7d5b8f8f4d5dcb3285c48 /src/library/coverart.cpp
parentadd4b1731eff61e0a4662f25e9469e02999dd8af (diff)
Add (background) color to cover art
Diffstat (limited to 'src/library/coverart.cpp')
-rw-r--r--src/library/coverart.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/library/coverart.cpp b/src/library/coverart.cpp
index cec54c1792..ffc5350a61 100644
--- a/src/library/coverart.cpp
+++ b/src/library/coverart.cpp
@@ -59,6 +59,7 @@ CoverInfoRelative::CoverInfoRelative()
void CoverInfoRelative::setImage(
const QImage& image) {
+ color = CoverImageUtils::extractBackgroundColor(image);
m_imageDigest = CoverImageUtils::calculateDigest(image);
DEBUG_ASSERT(image.isNull() == m_imageDigest.isEmpty());
m_legacyHash = calculateLegacyHash(image);
@@ -69,6 +70,7 @@ void CoverInfoRelative::setImage(
bool operator==(const CoverInfoRelative& lhs, const CoverInfoRelative& rhs) {
return lhs.source == rhs.source &&
lhs.type == rhs.type &&
+ lhs.color == rhs.color &&
lhs.legacyHash() == rhs.legacyHash() &&
lhs.imageDigest() == rhs.imageDigest() &&
lhs.coverLocation == rhs.coverLocation;
@@ -87,6 +89,8 @@ QDebug operator<<(QDebug dbg, const CoverInfoRelative& info) {
<< ','
<< sourceToString(info.source)
<< ','
+ << info.color
+ << ','
<< info.coverLocation
<< ','
<< info.imageDigest()