Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gui/tray: Do not generate JPEG images in async image response for macOS #7943

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/gui/tray/asyncimageresponse.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/gui/tray/asyncimageresponse.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/gui/tray/asyncimageresponse.cpp

File src/gui/tray/asyncimageresponse.cpp does not conform to Custom style guidelines. (lines 139, 140)
* Copyright (C) by Oleksandr Zolotov <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand All @@ -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)
{
Expand Down Expand Up @@ -135,6 +136,12 @@
} 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));
}
Expand Down
Loading