mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Fix blurhash discoloration on decode
This commit is contained in:
parent
2f08f5181c
commit
d163809551
1 changed files with 6 additions and 4 deletions
|
@ -27,16 +27,18 @@ BlurhashResponse::run()
|
||||||
|
|
||||||
auto decoded = blurhash::decode(QUrl::fromPercentEncoding(m_id.toUtf8()).toStdString(),
|
auto decoded = blurhash::decode(QUrl::fromPercentEncoding(m_id.toUtf8()).toStdString(),
|
||||||
m_requestedSize.width(),
|
m_requestedSize.width(),
|
||||||
m_requestedSize.height(),
|
m_requestedSize.height());
|
||||||
4);
|
|
||||||
if (decoded.image.empty()) {
|
if (decoded.image.empty()) {
|
||||||
m_error = QStringLiteral("Failed decode!");
|
m_error = QStringLiteral("Failed decode!");
|
||||||
emit finished();
|
emit finished();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage image(
|
QImage image(decoded.image.data(),
|
||||||
decoded.image.data(), (int)decoded.width, (int)decoded.height, QImage::Format_RGB32);
|
(int)decoded.width,
|
||||||
|
(int)decoded.height,
|
||||||
|
(int)decoded.width * 3,
|
||||||
|
QImage::Format_RGB888);
|
||||||
|
|
||||||
m_image = image.copy();
|
m_image = image.copy();
|
||||||
emit finished();
|
emit finished();
|
||||||
|
|
Loading…
Reference in a new issue