libgimp: only add the generic metadata aux arguments once.

There was at least a case when gimp_procedure_create_config() was called
twice, hence so was gimp_save_procedure_add_metadata() when a plug-in
was run.
It was happening when calling a procedure with less arguments than the
procedure had. In such case, gimp_procedure_run() would create a config
to fill it with defaults.

Fixes warnings such as:

> LibGimp-WARNING **: 01:29:57.044: Auxiliary argument with name 'save-exif' already exists on procedure 'file-png-save'
This commit is contained in:
Jehan 2021-04-04 01:23:48 +02:00
parent 6dd48d1a82
commit b78eb953f2
1 changed files with 6 additions and 1 deletions

View File

@ -396,7 +396,11 @@ gimp_save_procedure_create_config (GimpProcedure *procedure,
static void
gimp_save_procedure_add_metadata (GimpSaveProcedure *save_procedure)
{
GimpProcedure *procedure = GIMP_PROCEDURE (save_procedure);
GimpProcedure *procedure = GIMP_PROCEDURE (save_procedure);
static gboolean ran_once = FALSE;
if (ran_once)
return;
if (save_procedure->priv->supports_exif)
GIMP_PROC_AUX_ARG_BOOLEAN (procedure, "save-exif",
@ -445,6 +449,7 @@ gimp_save_procedure_add_metadata (GimpSaveProcedure *save_procedure)
GIMP_ARGUMENT_SYNC_PARASITE);
}
ran_once = TRUE;
}