From 4f7a45a0a6b28255fb4c1ccbb53fcf8a6958843a Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sun, 3 Nov 2019 01:17:40 +0100 Subject: Improve avatar look and layouting Thanks to red_sky for the feedback! --- src/MxcImageProvider.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/MxcImageProvider.cpp') diff --git a/src/MxcImageProvider.cpp b/src/MxcImageProvider.cpp index 86dbcabc..556b019b 100644 --- a/src/MxcImageProvider.cpp +++ b/src/MxcImageProvider.cpp @@ -6,7 +6,7 @@ void MxcImageResponse::run() { if (m_requestedSize.isValid()) { - QString fileName = QString("%1_%2x%3") + QString fileName = QString("%1_%2x%3_crop") .arg(m_id) .arg(m_requestedSize.width()) .arg(m_requestedSize.height()); @@ -23,7 +23,7 @@ MxcImageResponse::run() opts.mxc_url = "mxc://" + m_id.toStdString(); opts.width = m_requestedSize.width() > 0 ? m_requestedSize.width() : -1; opts.height = m_requestedSize.height() > 0 ? m_requestedSize.height() : -1; - opts.method = "scale"; + opts.method = "crop"; http::client()->get_thumbnail( opts, [this, fileName](const std::string &res, mtx::http::RequestErr err) { if (err) { @@ -38,8 +38,6 @@ MxcImageResponse::run() auto data = QByteArray(res.data(), res.size()); cache::client()->saveImage(fileName, data); m_image.loadFromData(data); - m_image = m_image.scaled( - m_requestedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); m_image.setText("mxc url", "mxc://" + m_id); emit finished(); -- cgit 1.5.1