homescreenapp/hsdomainmodel/src/hswallpaper.cpp
changeset 81 7dd137878ff8
parent 69 87476091b3f5
child 86 e4f038c420f7
--- a/homescreenapp/hsdomainmodel/src/hswallpaper.cpp	Fri Aug 13 14:38:12 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hswallpaper.cpp	Wed Aug 18 10:33:57 2010 +0300
@@ -260,10 +260,17 @@
 {
     QVariantHash targets;
 
+    QString targetSuffix("png");
+
+    // Qt doesn't support writing GIFs, so let's save those and everything else but JPGs as PNGs
+    if (QFileInfo(sourcePath).suffix().toUpper() == "JPG" ) {
+        targetSuffix = QString("jpg");
+    }
+
     QString path = wallpaperDirectory()
                    + QString("temp%1_").arg(mId)
                    + QString("%1.")
-                   + QFileInfo(sourcePath).suffix();
+                   + targetSuffix;
 
     targets.insert(path.arg("portrait"), QSize((2 * 360) + HSCONFIGURATION_GET(bounceEffect), 640));
     targets.insert(path.arg("landscape"), QSize((2 * 640) + HSCONFIGURATION_GET(bounceEffect), 360));
@@ -318,10 +325,17 @@
 {
     QVariantHash targets;
 
+    QString targetSuffix("png");
+
+    // Qt doesn't support writing GIFs, so let's save those and everything else but JPGs as PNGs
+    if (QFileInfo(sourcePath).suffix().toUpper() == "JPG" ) {
+        targetSuffix = QString("jpg");
+    }
+
     QString path = wallpaperDirectory()
                    + QString("temp%1_").arg(mId)
                    + QString("%1.")
-                   + QFileInfo(sourcePath).suffix();
+                   + targetSuffix;
 
     targets.insert(path.arg("portrait"), QSize(360, 640));
     targets.insert(path.arg("landscape"), QSize(640, 360));