1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-03 14:25:38 +02:00

conv-avatar: show a placeholder avatar when base64 data won't load

This does not fix the issue, it's a workaround in case the image data can't load. This may be related to loading large PNGs directly from base 64 strings.

Gitlab: #1329
Change-Id: I45729d10a33b8c8ad0adffb339dbcae40c4b18f9
This commit is contained in:
Andreas Traczyk 2023-08-29 11:58:57 -04:00 committed by Sébastien Blin
parent f605cfce81
commit 2371f0c09f

View file

@ -459,11 +459,10 @@ Utils::conversationAvatar(LRCInstance* instance,
auto avatarb64 = convModel->avatar(convId);
if (!avatarb64.isEmpty()) {
auto photo = imageFromBase64String(avatarb64, true);
if (photo.isNull()) {
qWarning() << "Invalid image for conversation " << convId;
return photo;
if (!photo.isNull()) {
return scaleAndFrame(photo, size);
}
return scaleAndFrame(photo, size);
qWarning() << "Couldn't load image from base 64 data for conversation " << convId;
}
// Else, generate an avatar
auto members = convModel->peersForConversation(convId);