[gimp] Bug 754774 - Choosing "convert" upon import results in wrong colors...



commit 145a05ac9de8d037c2dab35434aa0d0dc0f3f4fe
Author: Michael Natterer <mitch gimp org>
Date:   Wed Sep 9 21:21:20 2015 +0200

    Bug 754774 - Choosing "convert" upon import results in wrong colors...
    
    ...being displayed
    
    Need to call gimp_image_flush() on all newly opened images so whatever
    image states are properly updated:
    
    Call file_open_sanitize_image() at the end of loading (after profile
    import), and re-enable the flush() call in the function.
    
    Also, don't fiddle with undo disabling and enabling in
    gimp_image_import_color_profile(). Instead, disable undo before
    calling the function.

 app/core/gimpimage-color-profile.c |    5 -----
 app/file/file-open.c               |   23 ++++++-----------------
 2 files changed, 6 insertions(+), 22 deletions(-)
---
diff --git a/app/core/gimpimage-color-profile.c b/app/core/gimpimage-color-profile.c
index f97b137..0bfaa43 100644
--- a/app/core/gimpimage-color-profile.c
+++ b/app/core/gimpimage-color-profile.c
@@ -465,15 +465,10 @@ gimp_image_import_color_profile (GimpImage    *image,
           intent = config->display_intent;
           bpc    = (intent == GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC);
 
-          gimp_image_undo_disable (image);
-
           gimp_image_convert_color_profile (image, dest_profile,
                                             intent, bpc,
                                             progress, NULL);
 
-          gimp_image_clean_all (image);
-          gimp_image_undo_enable (image);
-
           g_object_unref (dest_profile);
         }
     }
diff --git a/app/file/file-open.c b/app/file/file-open.c
index 06edbc6..b15acb2 100644
--- a/app/file/file-open.c
+++ b/app/file/file-open.c
@@ -215,8 +215,6 @@ file_open_image (Gimp                *gimp,
     {
       if (image)
         {
-          file_open_sanitize_image (image, as_new);
-
           /* Only set the load procedure if it hasn't already been set. */
           if (! gimp_image_get_load_proc (image))
             gimp_image_set_load_proc (image, file_proc);
@@ -249,6 +247,8 @@ file_open_image (Gimp                *gimp,
 
   if (image)
     {
+      gimp_image_undo_disable (image);
+
       gimp_image_import_color_profile (image, context, progress,
                                        run_mode == GIMP_RUN_INTERACTIVE ?
                                        TRUE : FALSE);
@@ -261,6 +261,9 @@ file_open_image (Gimp                *gimp,
           /* We shall treat this file as an Untitled file */
           gimp_image_set_file (image, NULL);
         }
+
+      /* Enables undo again */
+      file_open_sanitize_image (image, as_new);
     }
 
   return image;
@@ -724,22 +727,8 @@ file_open_sanitize_image (GimpImage *image,
    */
   gimp_image_clean_all (image);
 
-#if 0
-  /* XXX this is not needed any longer, remove it when sure */
-
-  /* make sure the entire projection is properly constructed, because
-   * load plug-ins are not required to call gimp_drawable_update() or
-   * anything.
-   */
-  gimp_image_invalidate (image,
-                         0, 0,
-                         gimp_image_get_width  (image),
-                         gimp_image_get_height (image));
+  /* Make sure all image states are up-to-date */
   gimp_image_flush (image);
-
-  /* same for drawable previews */
-  gimp_image_invalidate_previews (image);
-#endif
 }
 
 /* Converts items from one image to another */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]