1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 01:12:40 +02:00

PDB: fix #14205 image-find-next-sample-point error

Three types declared in pdbgen perl code,
for sample-point, guides, and tatto objects,
declare too restrictive a range of permissible values.
They should allow the value 0, which the API uses as a sentinel value,
to represent "invalid object ID".
The types are for object ID's, which are unsigned.

GObject checks the declared range when you chunk into a GValueArray,
to call the PDB.

Declaring the attribute in the perl .pdb "no-validate"
is not sufficient since GObject doesn't understand
GIMP_PARAM_NO_VALIDATE, that flag is distinct from G_PARAM_NO_VALIDATE.

Only affects the ScriptFu binding to PDB.
The GI binding to libgimp is not affected.

The declared range is no more restrictive than the underlying type
"unsigned int 32."
So of no real consequence.

The API could be changed to return a list which the caller
would iterate on.
This commit is contained in:
lloyd konneker
2025-06-07 09:40:55 -04:00
committed by Lloyd Konneker
parent 7fd2489985
commit 69894d8bbf
5 changed files with 21 additions and 21 deletions

View File

@@ -467,7 +467,7 @@ CODE
g_param_spec_uint ("$name",
"$nick",
"$blurb",
1, G_MAXUINT32, 1,
0, G_MAXUINT32, 1,
$flags)
CODE
}
@@ -476,7 +476,7 @@ CODE
g_param_spec_uint ("$name",
"$nick",
"$blurb",
1, G_MAXUINT32, 1,
0, G_MAXUINT32, 1,
$flags)
CODE
}
@@ -485,7 +485,7 @@ CODE
g_param_spec_uint ("$name",
"$nick",
"$blurb",
1, G_MAXUINT32, 1,
0, G_MAXUINT32, 1,
$flags)
CODE
}