Skip to content
Snippets Groups Projects
Commit e8f48e4b authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

call: send compressed avatar

Load image with default format because on macOS loadFromData failed
when format is selected.

Change-Id: I889ed40fd90f218efb3dd872259bcd2993ef8786
parent 70255cb4
No related branches found
No related tags found
No related merge requests found
...@@ -151,10 +151,14 @@ QString ...@@ -151,10 +151,14 @@ QString
compressedAvatar(const QString& image) compressedAvatar(const QString& image)
{ {
QImage qimage; QImage qimage;
#ifdef ENABLE_LIBWRAP
auto ret = qimage.loadFromData(QByteArray::fromBase64(image.toUtf8()), 0);
#else
// Avoid to use all formats. Some seems bugguy, like libpbf, asking // Avoid to use all formats. Some seems bugguy, like libpbf, asking
// for a QGuiApplication for QFontDatabase // for a QGuiApplication for QFontDatabase
auto ret = qimage.loadFromData(QByteArray::fromBase64(image.toUtf8()), "JPEG"); auto ret = qimage.loadFromData(QByteArray::fromBase64(image.toUtf8()), "JPEG");
if (!ret) ret = qimage.loadFromData(QByteArray::fromBase64(image.toUtf8()), "PNG"); if (!ret) ret = qimage.loadFromData(QByteArray::fromBase64(image.toUtf8()), "PNG");
#endif
if (!ret) { if (!ret) {
qDebug() << "vCard image loading failed"; qDebug() << "vCard image loading failed";
return image; return image;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment