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



commit b1e11e5cf90e71f826e85520c6cab75a36081e6c
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
    
    (cherry picked from commit 9c85faddaabff8ba9c2e2cea06b21865ec57495b)

 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 22ec2ffc3e..063f201331 100644
--- a/plug-ins/common/file-png.c
+++ b/plug-ins/common/file-png.c
@@ -1130,19 +1130,23 @@ load_image (const gchar  *filename,
       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]