Merge pull request #7947 from nextcloud/backport/7943/stable-3.16

[stable-3.16] gui/tray: Do not generate JPEG images in async image response for macOS
This commit is contained in:
Camila Ayres 2025-03-03 14:01:20 +01:00 committed by GitHub
commit 7bbcd8ec60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,12 +12,13 @@
* for more details.
*/
#include "asyncimageresponse.h"
#include <QIcon>
#include <QPainter>
#include <QSvgRenderer>
#include "asyncimageresponse.h"
#include "usermodel.h"
#include "accountmanager.h"
AsyncImageResponse::AsyncImageResponse(const QString &id, const QSize &requestedSize)
{
@ -135,6 +136,12 @@ void AsyncImageResponse::slotProcessNetworkReply()
} else {
processNextImage();
}
#ifdef Q_OS_MACOS
// NOTE: We are facing issues with JPEGs at the moment on macOS with our Qt 6.8.2-based release.
// Do not create previews for JPEGs to prevent crashing.
} else if (imageData.startsWith(QByteArrayLiteral("\xFF\xD8")) && imageData.endsWith(QByteArrayLiteral("\xFF\xD9"))) {
processNextImage();
#endif
} else {
setImageAndEmitFinished(QImage::fromData(imageData));
}