[Gimp-user] script-fu-register -- SF-IMAGE -- what do the parameters mean?



I have a script-fu script that does some processing to an image and then saves
it with a new name provided by the user. The process is in the "Image" menu. It
works on whichever image is open and selected. I can open more images and the
script works on the new ones. However, if I close one of the images opend
earlier, the script causes this error:

Error: ( : 2) Procedure execution of gimp-image-get-filename failed on invalid
input arguments: Procedure 'gimp-image-get-filename' has been called with an
invalid ID for argument 'image'. Most likely a plug-in is trying to work on an
image that doesn't exist any longer.

Once this error occurs I have to exit GIMP and start up fresh.

Is there a way to overcome this?

I have tried playing with the values on the SF-IMAGE line. Changing them seems
to make no difference to the behavior. What are these parameters supposed to do?

here is my script-fu-register call:

(script-fu-register 
  "script-fu-process-sketch"
  "Process Sketch"
  "Save all opened images"
  "Tim Helck"
  "Tim Helck"
  "08/13/2017"
  ""
  SF-IMAGE  "Image"        -1   
  SF-STRING "New Name"     ""   ;a string variable
)

(script-fu-menu-register "script-fu-process-sketch" "<Image>/Image/Process
Sketch")

Also -- I am wondering, what difference, if any, does it make if I put this
script in a different menu?

Other Info:
Macbook 10.9.5 (Maverick)
GIMP 2.8.14

-- 
TimHelck (via www.gimpusers.com/forums)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]