Fix blurry thumbnails AGAIN

This commit is contained in:
Nicolas Werner 2021-12-08 23:07:13 +01:00
parent 8effdbc447
commit cf31fff5fe
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -100,7 +100,11 @@ MxcImageProvider::download(const QString &id,
if (temp != infos.end()) if (temp != infos.end())
encryptionInfo = *temp; encryptionInfo = *temp;
if (requestedSize.isValid() && !encryptionInfo) { if (requestedSize.isValid() &&
!encryptionInfo
// Protect against synapse not following the spec:
// https://github.com/matrix-org/synapse/issues/5302
&& requestedSize.height() <= 600 && requestedSize.width() <= 800) {
QString fileName = QString("%1_%2x%3_%4_radius%5") QString fileName = QString("%1_%2x%3_%4_radius%5")
.arg(QString::fromUtf8(id.toUtf8().toBase64( .arg(QString::fromUtf8(id.toUtf8().toBase64(
QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals))) QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals)))