Gimp-Forum.net

Full Version: Help! Wrong number of parameters
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to modify a channel using gimp_drawable_curves_spline. The line I am using is:

pdb.gimp_drawable_curves_spline(image,HISTOGRAM_VALUE,18,0.0,0.0,0.0625,0.125,0.125,0.250,0.250,0.375,0.5,0.5,0.75,0.625,0.875,0.750,0.9375,0.875,1.0,1.0)

It gives me an error of wrong number of parameters. Obviously something silly on my part, but I have checked my decimal points, counted my commas numerous times and still can't see what I am doing wrong!

Any help much appreciated.
david.
The fourth argument is an array, and instead your provide the number as individual arguments. Do something like:
Code:
splinePoints=[0.0,0.0,0.0625,0.125,0.125,0.250,0.250,0.375,0.5,0.5,0.75,0.625,0.875,0.750,0.9375,0.875,1.0,1.0]
pdb.gimp_drawable_curves_spline(image,HISTOGRAM_VALUE,len(splinePoints),splinePoints)
Ofnuts,
Many thanks for your reply
I copied the lines into my program, but when I try to run it I get an error. The message in the terminal is "TypeError: wrong parameter type".
I have struggled with this for many hours! Unfortunately searching the net has failed to find examples to follow.
david.
The first parameter is a "drawable", that is, a layer, layer mask, or channel. If "Image" is an image, it is not the right thing to pass.

I have done something similar (with that same API) in my ofn-luminosity-masks script that you'll find here (the script itself is discussed here)
Ofnuts,

Many thanks - problem solved!!!
I don't know what us gimpers would do without the help from you and Rich!!!

david.