You are here

Beginner questions on python plug-in and gimp 2.7

Hi Gimp Experts,

It seems to me Gimp 2.7 has enhanced some calling mechanism for Python. In the following registry content I took from http://www.ibm.com/developerworks/opensource/library/os-autogimp/index.h... (Listing 1 below), it only spells out three input parameters. But when I looked at the pluginrc file, Gimp actually made six input arguments (see Listing 2 please) out of this plug-in registry content. So, I tried the following command in my shell to call this script:

/opt/gimp-2.7/bin/gimp-2.7 -i -b '(python-fu-resize RUN-NONINTERACTIVE "myimage.png" "myimage_out.png" 200 200 TRUE)' -b '(gimp-quit 0)'

But it then gave me these two lines of issues.
>>>batch command experienced an execution error:
>>>Error: ( : 1) Invalid type for argument 2 to python-fu-resize

Questions:
1. What should I enter in my call to the script? I tried "myimage.png" and "myimage_out.png" for the image and drawable but obviously they are all wrong.
2. Are there any shell script samples that use Python and Gimp 2.7?

Thanks so much in advance for any pointers!

Sincerely,
Gimp_student_101

---------------------------------------- Listing 1 starts here: The register content. -----------------------
register(
"python_fu_resize",
"Saves the image at a maximum width and height",
"Saves the image at a maximum width and height",
"Nathan A. Good",
"Nathan A. Good",
"2010",
"/Image/Resize to max...",
"RGB*, GRAY*",
[
(PF_INT, "max_width", "Maximum Width", 500),
(PF_INT, "max_height", "Maximum Height", 500),
(PF_BOOL, "copy", "Make a JPEG copy", TRUE),
],
[],
plugin_main)

---------------------------------------- Listing 2 starts here: The generated Lisp functions in pluginrc. -----------------------
(plug-in-def "/home/tony/.gimp-2.7/plug-ins/test_register.py" 1325494784
(proc-def "python_fu_resize" 1
"Saves the image at a maximum width and height"
"Saves the image at a maximum width and height"
"Nathan A. Good"
"Nathan A. Good"
"2010"
"Resize to max..."
1
(menu-path "/Image")
(icon stock-id -1 "")
"RGB*, GRAY*"
6 0
(proc-arg 0 "run-mode" "The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }")
(proc-arg 13 "image" "Input image")
(proc-arg 16 "drawable" "Input drawable")
(proc-arg 0 "max-width" "Maximum Width")
(proc-arg 0 "max-height" "Maximum Height")
(proc-arg 0 "copy" "Make a JPEG copy")))

Subscribe to Comments for "Beginner questions on python plug-in and gimp 2.7"