diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-07-09 23:35:27 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-07-09 23:35:27 +0200 |
commit | d163809551d5db83f4c38899680231fb3725c560 (patch) | |
tree | 5f0d7232574e2656202c30c26b37982ef164d27e /src/BlurhashProvider.cpp | |
parent | Redesign invites and room preview joins (diff) | |
download | nheko-d163809551d5db83f4c38899680231fb3725c560.tar.xz |
Fix blurhash discoloration on decode
Diffstat (limited to 'src/BlurhashProvider.cpp')
-rw-r--r-- | src/BlurhashProvider.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/BlurhashProvider.cpp b/src/BlurhashProvider.cpp index 12a27b82..aef618a2 100644 --- a/src/BlurhashProvider.cpp +++ b/src/BlurhashProvider.cpp @@ -27,16 +27,18 @@ BlurhashResponse::run() auto decoded = blurhash::decode(QUrl::fromPercentEncoding(m_id.toUtf8()).toStdString(), m_requestedSize.width(), - m_requestedSize.height(), - 4); + m_requestedSize.height()); if (decoded.image.empty()) { m_error = QStringLiteral("Failed decode!"); emit finished(); return; } - QImage image( - decoded.image.data(), (int)decoded.width, (int)decoded.height, QImage::Format_RGB32); + QImage image(decoded.image.data(), + (int)decoded.width, + (int)decoded.height, + (int)decoded.width * 3, + QImage::Format_RGB888); m_image = image.copy(); emit finished(); |