[gimp/gimp-2-10] Issue #4194: resolution passes from 300ppi to 72ppi after saving.



commit e7478071e8fdc05f8e292fa37efd38b2b8b18969
Author: Jehan <jehan girinstud io>
Date:   Fri Nov 8 13:40:12 2019 +0100

    Issue #4194: resolution passes from 300ppi to 72ppi after saving.
    
    We are running gimp_image_set_imported_file() when saving, with NULL to
    drop the tie with the imported file. Let's only change the default
    resolutions when we actually set an imported file.
    
    Also set the `resolution_set` flag even when it doesn't change the
    current values (hence no undo or signals), for instance setting from 300
    to 300 PPI. In such case, even though nothing changes, the resolution
    has to still be considered as explicitly set.
    
    In the reporter case, any one of these 2 fixes is enough.
    See also commit fef9b1d2a3 (set to 72 PPI as default for imported files
    only) and commit a8f552da2fb (set imported file to NULL).
    
    (cherry picked from commit 417bf199c82481e85188d72862b70f85113e5fb7)

 app/core/gimpimage.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c
index 229c120ece..b807273037 100644
--- a/app/core/gimpimage.c
+++ b/app/core/gimpimage.c
@@ -2304,7 +2304,7 @@ gimp_image_set_imported_file (GimpImage *image,
       gimp_object_name_changed (GIMP_OBJECT (image));
     }
 
-  if (! private->resolution_set)
+  if (! private->resolution_set && file != NULL)
     {
       /* Unlike new files (which follow technological progress and will
        * use higher default resolution, or explicitly chosen templates),
@@ -2812,15 +2812,16 @@ gimp_image_set_resolution (GimpImage *image,
       yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
     return;
 
+  private->resolution_set = TRUE;
+
   if ((ABS (private->xresolution - xresolution) >= 1e-5) ||
       (ABS (private->yresolution - yresolution) >= 1e-5))
     {
       gimp_image_undo_push_image_resolution (image,
                                              C_("undo-type", "Change Image Resolution"));
 
-      private->xresolution    = xresolution;
-      private->yresolution    = yresolution;
-      private->resolution_set = TRUE;
+      private->xresolution = xresolution;
+      private->yresolution = yresolution;
 
       gimp_image_resolution_changed (image);
       gimp_image_size_changed_detailed (image,


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