[gimp] Some basics of loading and exporting the pass-through mode of layer groups in PSD.
- From: Alexandre Prokoudine <aprokoudine src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Some basics of loading and exporting the pass-through mode of layer groups in PSD.
- Date: Tue, 8 Aug 2017 22:33:26 +0000 (UTC)
commit 63b041046e5f2034d7aed505b9b0fcc2b61d0496
Author: Alexandre Prokoudine <alexandre prokoudine gmail com>
Date: Wed Aug 9 01:28:40 2017 +0300
Some basics of loading and exporting the pass-through mode of layer groups in PSD.
The plug-in is still missing two essential bits:
1) setting blend mode to a layer group;
2) preserving layer group when exporting to PSD.
plug-ins/file-psd/psd-save.c | 5 ++++-
plug-ins/file-psd/psd-util.c | 9 +++++++++
2 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/file-psd/psd-save.c b/plug-ins/file-psd/psd-save.c
index 7388ba2..753f4f0 100644
--- a/plug-ins/file-psd/psd-save.c
+++ b/plug-ins/file-psd/psd-save.c
@@ -280,7 +280,10 @@ psd_lmode_layer (gint32 idLayer,
case GIMP_LAYER_MODE_HARD_MIX:
strcpy (psdMode, "hMix");
break;
-
+ case GIMP_LAYER_MODE_PASS_THROUGH:
+ strcpy (psdMode, "pass");
+ break;
+
default:
{
const gchar *nick = "?";
diff --git a/plug-ins/file-psd/psd-util.c b/plug-ins/file-psd/psd-util.c
index 53039f2..2f856f6 100644
--- a/plug-ins/file-psd/psd-util.c
+++ b/plug-ins/file-psd/psd-util.c
@@ -615,6 +615,9 @@ psd_to_gimp_blend_mode (const gchar *psd_mode,
*/
if (layer_composite) *layer_composite = GIMP_LAYER_COMPOSITE_SRC_ATOP;
+ if (g_ascii_strncasecmp (psd_mode, "pass", 4) == 0) /* Pass through (CS)*/
+ return GIMP_LAYER_MODE_PASS_THROUGH;
+
if (g_ascii_strncasecmp (psd_mode, "norm", 4) == 0) /* Normal (ps3) */
{
if (layer_composite) *layer_composite = GIMP_LAYER_COMPOSITE_AUTO;
@@ -774,6 +777,11 @@ gimp_to_psd_blend_mode (GimpLayerMode layer_mode,
switch (layer_mode)
{
+
+ case GIMP_LAYER_MODE_PASS_THROUGH:
+ psd_mode = g_strndup ("pass", 4); /* Pass through (CS) */
+ break;
+
case GIMP_LAYER_MODE_NORMAL_LEGACY:
psd_mode = g_strndup ("norm", 4); /* Normal (ps3) */
break;
@@ -984,6 +992,7 @@ gimp_layer_mode_effects_name (GimpLayerMode mode)
"GRAIN EXTRACT",
"GRAIN MERGE",
"COLOR ERASE"
+ "PASS THROUGH"
};
static gchar *err_name = NULL;
if (mode >= 0 && mode <= GIMP_LAYER_MODE_COLOR_ERASE_LEGACY)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]