Change indentation to 4 spaces
This commit is contained in:
parent
e118f3882d
commit
cfca7157b9
165 changed files with 23146 additions and 23975 deletions
|
|
@ -13,33 +13,33 @@
|
|||
void
|
||||
BlurhashResponse::run()
|
||||
{
|
||||
if (m_requestedSize.width() < 0 || m_requestedSize.height() < 0) {
|
||||
m_error = QStringLiteral("Blurhash needs size request");
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
if (m_requestedSize.width() == 0 || m_requestedSize.height() == 0) {
|
||||
m_image = QImage(m_requestedSize, QImage::Format_RGB32);
|
||||
m_image.fill(QColor(0, 0, 0));
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
|
||||
auto decoded = blurhash::decode(QUrl::fromPercentEncoding(m_id.toUtf8()).toStdString(),
|
||||
m_requestedSize.width(),
|
||||
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,
|
||||
(int)decoded.width * 3,
|
||||
QImage::Format_RGB888);
|
||||
|
||||
m_image = image.copy();
|
||||
if (m_requestedSize.width() < 0 || m_requestedSize.height() < 0) {
|
||||
m_error = QStringLiteral("Blurhash needs size request");
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
if (m_requestedSize.width() == 0 || m_requestedSize.height() == 0) {
|
||||
m_image = QImage(m_requestedSize, QImage::Format_RGB32);
|
||||
m_image.fill(QColor(0, 0, 0));
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
|
||||
auto decoded = blurhash::decode(QUrl::fromPercentEncoding(m_id.toUtf8()).toStdString(),
|
||||
m_requestedSize.width(),
|
||||
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,
|
||||
(int)decoded.width * 3,
|
||||
QImage::Format_RGB888);
|
||||
|
||||
m_image = image.copy();
|
||||
emit finished();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue