[gimp] plug-ins: in file-psd, read/write layer group expanded state
- From: N/A <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins: in file-psd, read/write layer group expanded state
- Date: Sun, 22 Oct 2017 16:31:33 +0000 (UTC)
commit 6fb497247d6bf3c9cccd6e92974c010dbc7f723c
Author: Ell <ell_se yahoo com>
Date: Sun Oct 22 12:01:57 2017 -0400
plug-ins: in file-psd, read/write layer group expanded state
Use the new gimp-item-{get,set}-expanded() PDB functions to read
and write group-layer expanded state in PSDs.
plug-ins/file-psd/psd-load.c | 7 +++++++
plug-ins/file-psd/psd-save.c | 2 +-
2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c
index d691b55..198a9e8 100644
--- a/plug-ins/file-psd/psd-load.c
+++ b/plug-ins/file-psd/psd-load.c
@@ -1463,6 +1463,13 @@ add_layers (gint32 image_id,
/* Tattoo */
if (lyr_a[lidx]->id)
gimp_item_set_tattoo (layer_id, lyr_a[lidx]->id);
+
+ /* For layer groups, expand or collapse the group */
+ if (lyr_a[lidx]->group_type != 0)
+ {
+ gimp_item_set_expanded (layer_id,
+ lyr_a[lidx]->group_type == 1);
+ }
}
/* Insert the layer */
diff --git a/plug-ins/file-psd/psd-save.c b/plug-ins/file-psd/psd-save.c
index ff8943a..7057ad0 100644
--- a/plug-ins/file-psd/psd-save.c
+++ b/plug-ins/file-psd/psd-save.c
@@ -1082,7 +1082,7 @@ save_layer_and_mask (FILE *fd,
size = 12;
if (PSDImageData.lLayers[i].type == PSD_LAYER_TYPE_GROUP_START)
- type = 1;
+ type = gimp_item_get_expanded (PSDImageData.lLayers[i].id) ? 1 : 2;
else
type = 3;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]