summary refs log tree commit diff
path: root/src/BlurhashProvider.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-07-09 23:35:27 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-07-09 23:35:27 +0200
commitd163809551d5db83f4c38899680231fb3725c560 (patch)
tree5f0d7232574e2656202c30c26b37982ef164d27e /src/BlurhashProvider.cpp
parentRedesign invites and room preview joins (diff)
downloadnheko-d163809551d5db83f4c38899680231fb3725c560.tar.xz
Fix blurhash discoloration on decode
Diffstat (limited to 'src/BlurhashProvider.cpp')
-rw-r--r--src/BlurhashProvider.cpp10
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();