Skip to content
Snippets Groups Projects
Commit 2371f0c0 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Sébastien Blin
Browse files

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
parent f605cfce
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment