OSDN Git Service

kioslave: check thumbnail image depth after rotating it
authorIvailo Monev <xakepa10@gmail.com>
Sun, 25 Jul 2021 00:11:55 +0000 (03:11 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 25 Jul 2021 00:11:55 +0000 (03:11 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
kioslave/thumbnail/imagecreator.cpp

index 551f56f..041810c 100644 (file)
@@ -41,10 +41,9 @@ extern "C"
 bool ImageCreator::create(const QString &path, int, int, QImage &img)
 {
     // create image preview
-    if (!img.load( path ))
+    if (!img.load(path)) {
         return false;
-    if (img.depth() != 32)
-        img = img.convertToFormat(img.hasAlphaChannel() ? QImage::Format_ARGB32 : QImage::Format_RGB32);
+    }
 
 #ifdef HAVE_KEXIV2
     ImageCreatorSettings* settings = ImageCreatorSettings::self();
@@ -55,6 +54,10 @@ bool ImageCreator::create(const QString &path, int, int, QImage &img)
     }
 #endif
 
+    if (img.depth() != 32) {
+        img = img.convertToFormat(img.hasAlphaChannel() ? QImage::Format_ARGB32 : QImage::Format_RGB32);
+    }
+
     return true;
 }