I want to add a layer of lens distortion to the photo being edited, and
this function call:
# add lens distortion
pdb.plug_in_lens_distortion(RUN_NONINTERACTIVE,timg,tdrawable,1.1,refractive_index,1.1,1.1)
returns an error:
# start error text
Traceback (most recent call last):
File "/opt/gnome/lib/gimp/2.0/python/gimpfu.py", line 662, in response
dialog.res = run_script(params)
File "/opt/gnome/lib/gimp/2.0/python/gimpfu.py", line 347, in run_script
return apply(function, params)
File "/home/jim/.gimp-2.4/plug-ins/lomo.py", line 56, in python_lomo
pdb.plug_in_applylens(RUN_NONINTERACTIVE,timg,tdrawable,refractive_index,True,False,False)
TypeError: wrong number of parameters
# end error text
I've done everything I can think of, including hard-coding values as
arguments.
Can anyone help?
TIA,
Jim
Your function call above actually does have an incorrect
number of arguments. The documentation says it requires,
run-mode INT32
image IMAGE
drawable DRAWABLE
offset-x FLOAT
offset-y FLOAT
main-adjust FLOAT
edge-adjust FLOAT
rescale FLOAT
brighten FLOAT
However, the pdb.plug_in_*() functions, which are all
listed with a run-mode argument, from python-fu do not
actually want to see that argument, so it has to be
called as
pdb.plug_in_lens_distortion(image, drawable, offset_x,
offset_y, main_adjust, edge_adjust, rescale, brighten)
image IMAGE
drawable DRAWABLE
offset-x FLOAT
offset-y FLOAT
main-adjust FLOAT
edge-adjust FLOAT
rescale FLOAT
brighten FLOAT
I don't know what the reason for that is, and don't even
know if it is documented. I just happened to see that
in the several python scripts that come with GIMP source
code, the pdb.plug_in_* functions were all being called
that way.
--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) fl...@apaflo.com
Thank you Floyd. I never would have guessed that one.
Jim