From 2d2f1d048dc661d1bd3f84e59ae6931135e011bd Mon Sep 17 00:00:00 2001 From: Jehan Date: Thu, 12 Jun 2025 12:15:41 +0200 Subject: [PATCH] Revert "PDB: fix #14205 image-find-next-sample-point error" This reverts commit 69894d8bbff24c85f8d98c65e0a2951ae7f8d1e2. Let's not randomly make our API less strict on types as a workaround for a bug. If there are specific cases where it's needed to accept 0, then these are the cases we have to handle. Also unlike what the commit message was saying, it's not true that this was only affecting Script-Fu. Any change to the PDB affects by definition the whole PDB, as well as libgimp and all bindings (over PDB or libgimp alike). And yes, this change **was** of "real consequence". I'll do further commits for the proper fixes to #14205. --- app/pdb/image-cmds.c | 10 +++++----- app/pdb/image-guides-cmds.c | 12 ++++++------ app/pdb/image-sample-points-cmds.c | 10 +++++----- app/pdb/item-cmds.c | 4 ++-- pdb/app.pl | 6 +++--- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/pdb/image-cmds.c b/app/pdb/image-cmds.c index f5cb86985f..449c9fd53a 100644 --- a/app/pdb/image-cmds.c +++ b/app/pdb/image-cmds.c @@ -5439,7 +5439,7 @@ register_image_procs (GimpPDB *pdb) g_param_spec_uint ("tattoo-state", "tattoo state", "The tattoo state", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); @@ -5468,7 +5468,7 @@ register_image_procs (GimpPDB *pdb) g_param_spec_uint ("tattoo-state", "tattoo state", "The new image tattoo state", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); @@ -5497,7 +5497,7 @@ register_image_procs (GimpPDB *pdb) g_param_spec_uint ("tattoo", "tattoo", "The tattoo of the layer to find", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, gimp_param_spec_layer ("layer", @@ -5532,7 +5532,7 @@ register_image_procs (GimpPDB *pdb) g_param_spec_uint ("tattoo", "tattoo", "The tattoo of the channel to find", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, gimp_param_spec_channel ("channel", @@ -5567,7 +5567,7 @@ register_image_procs (GimpPDB *pdb) g_param_spec_uint ("tattoo", "tattoo", "The tattoo of the path to find", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, gimp_param_spec_path ("path", diff --git a/app/pdb/image-guides-cmds.c b/app/pdb/image-guides-cmds.c index 964980e186..29835fb21e 100644 --- a/app/pdb/image-guides-cmds.c +++ b/app/pdb/image-guides-cmds.c @@ -296,7 +296,7 @@ register_image_guides_procs (GimpPDB *pdb) g_param_spec_uint ("guide", "guide", "The new guide", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); @@ -331,7 +331,7 @@ register_image_guides_procs (GimpPDB *pdb) g_param_spec_uint ("guide", "guide", "The new guide", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); @@ -360,7 +360,7 @@ register_image_guides_procs (GimpPDB *pdb) g_param_spec_uint ("guide", "guide", "The ID of the guide to be removed", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); @@ -395,7 +395,7 @@ register_image_guides_procs (GimpPDB *pdb) g_param_spec_uint ("next-guide", "next guide", "The next guide's ID", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); @@ -424,7 +424,7 @@ register_image_guides_procs (GimpPDB *pdb) g_param_spec_uint ("guide", "guide", "The guide", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, gimp_param_spec_enum ("orientation", @@ -462,7 +462,7 @@ register_image_guides_procs (GimpPDB *pdb) g_param_spec_uint ("guide", "guide", "The guide", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, g_param_spec_int ("position", diff --git a/app/pdb/image-sample-points-cmds.c b/app/pdb/image-sample-points-cmds.c index 4f0fe8d6c3..1a17fafbca 100644 --- a/app/pdb/image-sample-points-cmds.c +++ b/app/pdb/image-sample-points-cmds.c @@ -240,7 +240,7 @@ register_image_sample_points_procs (GimpPDB *pdb) g_param_spec_uint ("sample-point", "sample point", "The new sample point", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); @@ -269,7 +269,7 @@ register_image_sample_points_procs (GimpPDB *pdb) g_param_spec_uint ("sample-point", "sample point", "The ID of the sample point to be removed", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); @@ -298,13 +298,13 @@ register_image_sample_points_procs (GimpPDB *pdb) g_param_spec_uint ("sample-point", "sample point", "The ID of the current sample point (0 if first invocation)", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE)); gimp_procedure_add_return_value (procedure, g_param_spec_uint ("next-sample-point", "next sample point", "The next sample point's ID", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); @@ -333,7 +333,7 @@ register_image_sample_points_procs (GimpPDB *pdb) g_param_spec_uint ("sample-point", "sample point", "The guide", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_procedure_add_return_value (procedure, g_param_spec_int ("position-x", diff --git a/app/pdb/item-cmds.c b/app/pdb/item-cmds.c index 163a8dfa4f..0e547397b5 100644 --- a/app/pdb/item-cmds.c +++ b/app/pdb/item-cmds.c @@ -1919,7 +1919,7 @@ register_item_procs (GimpPDB *pdb) g_param_spec_uint ("tattoo", "tattoo", "The item tattoo", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); @@ -1948,7 +1948,7 @@ register_item_procs (GimpPDB *pdb) g_param_spec_uint ("tattoo", "tattoo", "The new item tattoo", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); diff --git a/pdb/app.pl b/pdb/app.pl index e769e8b434..fec21aadae 100644 --- a/pdb/app.pl +++ b/pdb/app.pl @@ -467,7 +467,7 @@ CODE g_param_spec_uint ("$name", "$nick", "$blurb", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, $flags) CODE } @@ -476,7 +476,7 @@ CODE g_param_spec_uint ("$name", "$nick", "$blurb", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, $flags) CODE } @@ -485,7 +485,7 @@ CODE g_param_spec_uint ("$name", "$nick", "$blurb", - 0, G_MAXUINT32, 1, + 1, G_MAXUINT32, 1, $flags) CODE }