Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help! Wrong number of parameters
#1
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.
Reply
#2
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)
Reply
#3
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.
Reply
#4
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)
Reply
#5
Ofnuts,

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

david.
Reply


Forum Jump: