Skip to content
Snippets Groups Projects
Commit c4ad5769 authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

messagesadapter: use decideFormatFromContent for QImageReader

Change-Id: Ib225b2fbc739f10802fd5951bf9c04b5767da024
parent dc060370
No related branches found
No related tags found
No related merge requests found
......@@ -361,9 +361,14 @@ MessagesAdapter::setNewMessagesContent(const QString& path)
{
if (path.length() == 0)
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);
} else {
setMessagesFileContent(path);
......
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