[Digikam-devel] extragear/graphics/digikam/utilities/imageeditor/editor

Gilles Caulier caulier.gilles at free.fr
Fri Dec 30 22:19:13 GMT 2005


SVN commit 492732 by cgilles:

digikam from trunk : Image editor BUGFIX in SaveAs method : when an user set an image file name with an extension without using mime type combo list from save as dialog, we need to check this file name extension before to perform image saving, else image editor will failed.

Tom, we need to backport this fix on stable branch please...

CCMAIL: digikam-devel at kde.org


 M  +12 -3     imagewindow.cpp  


--- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/imagewindow.cpp #492731:492732
@@ -1072,12 +1072,21 @@
     }
 
     KURL newURL = imageFileSaveDialog.selectedURL();
+
+    // Check if target image format have been selected from Combo List of SaveAs dialog.
     QString format = KImageIO::typeForMime(imageFileSaveDialog.currentMimeFilter());
+
     if (format.isEmpty())
     {
-        // if the format is empty then file format is same as that of the
-        // original file
-        format = QImageIO::imageFormat(m_urlCurrent.path());
+        // Else, check if target image format have been add to target image file name using extension.
+        QFileInfo fi(newURL.path());
+        format = fi.extension(false);
+
+        if (format.isEmpty())
+        {
+            // Else, the format is empty then file format is same as that of the original file.
+            format = QImageIO::imageFormat(m_urlCurrent.path());
+        }
     }
     
     if (!newURL.isValid())



More information about the Digikam-devel mailing list