[gimp] #5977 prompt to apply layer offset only if there actually is a (non-zero) offset



commit 9c85faddaabff8ba9c2e2cea06b21865ec57495b
Author: dlatikay <dlatikay outlook com>
Date:   Wed Dec 2 20:48:48 2020 +0000

    #5977 prompt to apply layer offset only if there actually is a (non-zero) offset

 plug-ins/common/file-png.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/plug-ins/common/file-png.c b/plug-ins/common/file-png.c
index 947411b50e..3b7ba75fcc 100644
--- a/plug-ins/common/file-png.c
+++ b/plug-ins/common/file-png.c
@@ -869,19 +869,23 @@ load_image (GFile        *file,
       gint offset_x = png_get_x_offset_pixels (pp, info);
       gint offset_y = png_get_y_offset_pixels (pp, info);
 
-      if (! interactive)
+      if (offset_x != 0 ||
+          offset_y != 0)
         {
-          gimp_layer_set_offsets (layer, offset_x, offset_y);
-        }
-      else if (offsets_dialog (offset_x, offset_y))
-        {
-          gimp_layer_set_offsets (layer, offset_x, offset_y);
-
-          if (abs (offset_x) > width ||
-              abs (offset_y) > height)
+          if (! interactive)
+            {
+              gimp_layer_set_offsets (layer, offset_x, offset_y);
+            }
+          else if (offsets_dialog (offset_x, offset_y))
             {
-              g_message (_("The PNG file specifies an offset that caused "
-                           "the layer to be positioned outside the image."));
+              gimp_layer_set_offsets (layer, offset_x, offset_y);
+
+              if (abs (offset_x) > width ||
+                  abs (offset_y) > height)
+                {
+                  g_message (_("The PNG file specifies an offset that caused "
+                               "the layer to be positioned outside the image."));
+                }
             }
         }
     }


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