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.
This commit is contained in:
Alx Sa
2024-12-28 14:52:46 +00:00
parent 5434fb6e30
commit c6d38fa551

View File

@ -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"));