From c6d38fa551e659853bda2e3cf228504779f9c2c4 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Sat, 28 Dec 2024 14:52:46 +0000 Subject: [PATCH] plug-ins: Don't use compose-type on Recompose Resolves #12623 Compose and Recompose are in the same plug-in. When we converted compose.c to use GimpChoice in 7b29ac24, we did so without checking if it was being called by Compose or Recompose. As a result, we always overwrote compose_type with 0 (RGB mode) on Recompose since it did not have a "compose-type" GimpChoice property. This patch adds a check to make sure we're not in a Recompose call before trying to set compose_type from the GimpChoice parameter. --- plug-ins/common/compose.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plug-ins/common/compose.c b/plug-ins/common/compose.c index f79458b91b..0b8a5e9083 100644 --- a/plug-ins/common/compose.c +++ b/plug-ins/common/compose.c @@ -759,12 +759,16 @@ compose_run (GimpProcedure *procedure, } } - compose_idx = gimp_procedure_config_get_choice_id (config, "compose-type"); - if (compose_idx >= 0 && compose_idx < G_N_ELEMENTS (compose_dsc)) + if (strcmp (name, RECOMPOSE_PROC) != 0) { - g_strlcpy (composevals.compose_type, - compose_dsc[compose_idx].compose_type, - sizeof (composevals.compose_type)); + compose_idx = gimp_procedure_config_get_choice_id (config, "compose-type"); + + if (compose_idx >= 0 && compose_idx < G_N_ELEMENTS (compose_dsc)) + { + g_strlcpy (composevals.compose_type, + compose_dsc[compose_idx].compose_type, + sizeof (composevals.compose_type)); + } } gimp_progress_init (_("Composing"));