[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [plasma-workspace] wallpapers/image: wallpapers/image: Use QImageReader in ImageSizeFinder::run()
From:       Fredrik_Höglund <null () kde ! org>
Date:       2017-01-05 0:55:03
Message-ID: E1cOwKd-00063w-Nz () code ! kde ! org
[Download RAW message or body]

Git commit ee245780f236fe862339dea9fb8a9a029f32aeba by Fredrik Höglund.
Committed on 05/01/2017 at 00:51.
Pushed by fredrik into branch 'master'.

wallpapers/image: Use QImageReader in ImageSizeFinder::run()

There is no need to decode the whole image and load it into memory
when we are only interested in the dimensions.

Differential Revision: https://phabricator.kde.org/D3973

M  +2    -2    wallpapers/image/backgroundlistmodel.cpp

https://commits.kde.org/plasma-workspace/ee245780f236fe862339dea9fb8a9a029f32aeba

diff --git a/wallpapers/image/backgroundlistmodel.cpp b/wallpapers/image/backgroundlistmodel.cpp
index 1a5576b1..e24db26b 100644
--- a/wallpapers/image/backgroundlistmodel.cpp
+++ b/wallpapers/image/backgroundlistmodel.cpp
@@ -55,8 +55,8 @@ ImageSizeFinder::ImageSizeFinder(const QString &path, QObject *parent)
 
 void ImageSizeFinder::run()
 {
-    QImage image(m_path);
-    Q_EMIT sizeFound(m_path, image.size());
+    QImageReader reader(m_path);
+    Q_EMIT sizeFound(m_path, reader.size());
 }
 
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic