--- app/actions/file-commands.c.orig	2012-07-17 22:57:40.000000000 +0200
+++ app/actions/file-commands.c	2012-11-23 00:49:55.000000000 +0100
@@ -17,6 +17,7 @@
 
 #include "config.h"
 
+#include <stdlib.h> /* for system() */
 #include <string.h>
 
 #include <gegl.h>
@@ -237,8 +238,29 @@
            ! GIMP_GUI_CONFIG (image->gimp->config)->trust_dirty_flag) ||
           uri == NULL)
         {
-          GimpPlugInProcedure *save_proc = gimp_image_get_save_proc (image);
-
+          GimpPlugInProcedure *save_proc;
+          gboolean change_save_stat;
+          gboolean overwrite;
+                    
+          /* skip if the image is not dirty and is not xcf or imported
+             meaning: new images are saved anyway
+           */
+          if (! gimp_image_is_dirty (image) && (uri || gimp_image_get_imported_uri (image))) {
+            break;
+          }
+          
+          if (gimp_image_imported_is_savable (image)) {
+            uri = gimp_image_get_imported_uri (image);
+            save_proc = file_procedure_find (image->gimp->plug_in_manager->export_procs,
+                                             uri, NULL);
+            change_save_stat = FALSE;
+            overwrite = TRUE;
+          } else {
+            save_proc = gimp_image_get_save_proc (image);
+            change_save_stat = TRUE;
+            overwrite = FALSE;
+          }
+          
           if (uri && ! save_proc)
             {
               save_proc =
@@ -252,7 +274,12 @@
                                                    gimp, image, uri,
                                                    save_proc,
                                                    GIMP_RUN_WITH_LAST_VALS,
-                                                   TRUE, FALSE, FALSE, TRUE);
+                                                   change_save_stat,
+                                                   overwrite, FALSE,
+                                                   TRUE);              
+              if (gimp_image_imported_is_savable (image))
+                gimp_image_clean_all (image);
+              
               break;
             }
 
--- app/file/file-save.c.orig	2012-07-17 22:57:42.000000000 +0200
+++ app/file/file-save.c	2012-11-22 01:03:59.000000000 +0100
@@ -84,6 +84,7 @@
   gchar             *filename;
   gint32             image_ID;
   gint32             drawable_ID;
+  gboolean           imported_is_savable;
 
   g_return_val_if_fail (GIMP_IS_GIMP (gimp), GIMP_PDB_CALLING_ERROR);
   g_return_val_if_fail (GIMP_IS_IMAGE (image), GIMP_PDB_CALLING_ERROR);
@@ -103,6 +104,9 @@
     return GIMP_PDB_EXECUTION_ERROR;
 
   filename = file_utils_filename_from_uri (uri);
+  
+  /* test if we have an non-xcf imported image which is savable via File -> Save */
+  imported_is_savable = gimp_image_imported_is_savable (image);
 
   if (filename)
     {
@@ -194,9 +198,14 @@
            * at the same time, so stop consider it as imported now
            * that we consider it exported.
            */
-          gimp_image_set_imported_uri (image, NULL);
-
+          /* do this only if the imported image is not savable. 
+           * for more informatation, see gimp_image_imported_is_savable ()
+           */
+          if (!imported_is_savable) {
+            gimp_image_set_imported_uri (image, NULL);
+          }
           gimp_image_export_clean_all (image);
+          
         }
 
       if (export_backward || export_forward)
--- app/core/gimpimage.h.orig	2012-07-17 22:57:42.000000000 +0200
+++ app/core/gimpimage.h	2012-11-22 00:50:49.000000000 +0100
@@ -487,5 +487,7 @@
 
 const gchar   * gimp_image_get_string_untitled   (void);
 
+/* test if a non-xcf image can be saved via File -> Save */
+gboolean        gimp_image_imported_is_savable   (GimpImage *image);
 
 #endif /* __GIMP_IMAGE_H__ */
--- app/core/gimpimage.c.orig	2012-07-17 22:57:42.000000000 +0200
+++ app/core/gimpimage.c	2012-11-23 18:37:22.000000000 +0100
@@ -4190,3 +4190,14 @@
   gimp_item_stack_invalidate_previews (layers);
   gimp_item_stack_invalidate_previews (channels);
 }
+
+/* test if a non-xcf image can be saved via File -> Save */
+
+gboolean gimp_image_imported_is_savable (GimpImage *image)
+{
+  gboolean retval = FALSE;
+  
+  retval = gimp_image_get_imported_uri (image) && (gimp_image_get_n_layers (image) == 1);
+    
+  return retval;
+}
