[gimp] plug-ins: in file-psd, fix potential group-layer naming conflict during loading



commit 6ecce4cbf935403c97dc786d3888602a16f653c0
Author: Ell <ell_se yahoo com>
Date:   Mon Sep 4 13:37:54 2017 -0400

    plug-ins: in file-psd, fix potential group-layer naming conflict during loading
    
    Set the layer name of group layers early on, while processing their
    end marker, so that the default group name won't collide with the
    names of subsequent layers, leading to wrong layer names.  The real
    name of the group layer is set again when processing its start
    marker.

 plug-ins/file-psd/psd-load.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c
index d163f78..3080d71 100644
--- a/plug-ins/file-psd/psd-load.c
+++ b/plug-ins/file-psd/psd-load.c
@@ -1420,15 +1420,19 @@ add_layers (gint32     image_id,
 
           if (layer_id != -1)
             {
+              /* Set the layer name.  Note that we do this even for group-end
+               * markers, to avoid having the default group name collide with
+               * subsequent layers; the real group name is set by the group
+               * start marker.
+               */
+              gimp_item_set_name (layer_id, lyr_a[lidx]->name);
+
               /* Set the layer properties (skip this for layer group end
                * markers; we set their properties when processing the start
                * marker.)
                */
               if (lyr_a[lidx]->group_type != 3)
                 {
-                  /* Name */
-                  gimp_item_set_name (layer_id, lyr_a[lidx]->name);
-
                   /* Mode */
                   psd_to_gimp_blend_mode (lyr_a[lidx]->blend_mode, &mode_info);
                   gimp_layer_set_mode (layer_id, mode_info.mode);


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