Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gimp.ParamSpec.int() default value triggers “invalid or out of range” warning
#1
Question 
Hi folks — I'm working on a plugin for GIMP 3.0 and running into a strange behavior with Gimp.ParamSpec.int.

When I define a property like seed with:

python
proc.add_argument(
    Gimp.ParamSpec.int(
        "seed",
        "Seed",
        "Seed value",
        0,       # min
        9999,    # max
        9999,    # default
        Gimp.ParamFlags.READWRITE
    )
)


I get this warning at plugin registration:


Warning: value "9999" of type 'gint' is invalid or out of range for property 'seed' of type 'gint'

min <= max => default 

The default is clearly within the defined min/max bounds, and all three values (min, max, default) are legitimate. Strangely, the only setup that suppresses this warning is when all three values are **exactly the same** (we call it the triple x same bug), like:

python

0, 0, 0

or


1024, 1024, 1024

Even common combinations like:

python

0, 9999, 0


512, 2048, 1024

or:
python
0, 9999, 5000


cause the warning to appear and as a result, the plug-in is not registered. I’ve searched around but haven’t found an explanation. Is this a known quirk in GIMP’s plugin API? Are there hidden constraints on gint properties that aren’t documented?

Any ideas or workarounds would be appreciated!

Thanks ?

Olaf
Reply
#2
Use add_int_argument() instead (in fact I don' t see any documented add_argument() method).
Reply
#3
(5 hours ago)Ofnuts Wrote: Use add_int_argument() instead (in fact I don' t see any documented add_argument() method).

Hi, my bad, I am using add_int_argument() (it was late)

Thanks for your time

Olaf

PS I'll update my post
Reply


Forum Jump: