Speed up blurhash code

This commit is contained in:
Nicolas Werner 2020-03-04 01:30:43 +01:00
parent 0fc98b2692
commit 5ac18f1f5f
4 changed files with 10 additions and 18 deletions

View file

@ -332,6 +332,8 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
QImage img;
img.loadFromData(bin);
if (img.height() > 200 && img.width() > 360)
img = img.scaled(360, 200, Qt::KeepAspectRatioByExpanding);
std::vector<unsigned char> data;
for (int y = 0; y < img.height(); y++) {
for (int x = 0; x < img.width(); x++) {