summary refs log tree commit diff
path: root/src/MxcImageProvider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MxcImageProvider.cpp')
-rw-r--r--src/MxcImageProvider.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/MxcImageProvider.cpp b/src/MxcImageProvider.cpp
index a20657c8..ab6540a4 100644
--- a/src/MxcImageProvider.cpp
+++ b/src/MxcImageProvider.cpp
@@ -69,7 +69,7 @@ MxcImageProvider::download(const QString &id,
                 QDir().mkpath(fileInfo.absolutePath());
 
                 if (fileInfo.exists()) {
-                        QImage image(fileInfo.absoluteFilePath());
+                        QImage image = utils::readImageFromFile(fileInfo.absoluteFilePath());
                         if (!image.isNull()) {
                                 image = image.scaled(
                                   requestedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
@@ -143,7 +143,8 @@ MxcImageProvider::download(const QString &id,
                                                 return;
                                         }
                                 } else {
-                                        QImage image(fileInfo.absoluteFilePath());
+                                        QImage image =
+                                          utils::readImageFromFile(fileInfo.absoluteFilePath());
                                         if (!image.isNull()) {
                                                 then(id,
                                                      requestedSize,
@@ -190,7 +191,8 @@ MxcImageProvider::download(const QString &id,
                                           return;
                                   }
 
-                                  QImage image(fileInfo.absoluteFilePath());
+                                  QImage image =
+                                    utils::readImageFromFile(fileInfo.absoluteFilePath());
                                   image.setText("original filename",
                                                 QString::fromStdString(originalFilename));
                                   image.setText("mxc url", "mxc://" + id);