mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-31 12:13:36 +02:00
messagesadapter: use decideFormatFromContent for QImageReader
Change-Id: Ib225b2fbc739f10802fd5951bf9c04b5767da024
This commit is contained in:
parent
dc060370f4
commit
c4ad576985
1 changed files with 7 additions and 2 deletions
|
@ -361,9 +361,14 @@ MessagesAdapter::setNewMessagesContent(const QString& path)
|
||||||
{
|
{
|
||||||
if (path.length() == 0)
|
if (path.length() == 0)
|
||||||
return;
|
return;
|
||||||
QByteArray imageFormat = QImageReader::imageFormat(path);
|
|
||||||
|
|
||||||
if (!imageFormat.isEmpty()) {
|
// QImageReader will treat .gz file (Jami archive) as svgz image format
|
||||||
|
// so decideFormatFromContent is needed
|
||||||
|
QImageReader reader;
|
||||||
|
reader.setDecideFormatFromContent(true);
|
||||||
|
reader.setFileName(path);
|
||||||
|
|
||||||
|
if (!reader.read().isNull()) {
|
||||||
setMessagesImageContent(path);
|
setMessagesImageContent(path);
|
||||||
} else {
|
} else {
|
||||||
setMessagesFileContent(path);
|
setMessagesFileContent(path);
|
||||||
|
|
Loading…
Add table
Reference in a new issue