RSS/Atom feed Twitter
Site is read-only, email is disabled

script-fu-round-corners

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

3 of 3 messages available
Toggle history

Please log in to manage your subscriptions.

script-fu-round-corners John Dey 15 Jun 17:00
  script-fu-round-corners John Dey 15 Jun 21:02
   script-fu-round-corners Rob Antonishen 15 Jun 21:38
John Dey
2010-06-15 17:00:35 UTC (over 14 years ago)

script-fu-round-corners

Hi List,

I circulated a script yesterday for rounding corners using the above listed script. I got two suggestions for changes but neither resulting in a working script. Is there a list member that would be willing to send me a small working script using "script-fu-round-corners" so I can learn how to use it. Thank you very much.

John

John Dey
2010-06-15 21:02:11 UTC (over 14 years ago)

script-fu-round-corners

Hi List,

I thought I might tie off this thread by indicating that I now have a working script. It appears the definition for "script-fu-round-corners" in script-fu console is in error in that the "run-mode" variable indicated is not reflected in the definition of the script. I removed the RUN-NONINTERACTIVE from my script and I was off and running. Here is the final script:

(define (round-corners filein fileout) (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filein filein))) (drawable (car (gimp-image-get-active-layer image)))) (set! drawable (car (gimp-image-flatten image))) (script-fu-round-corners image drawable 15.0 TRUE 8.0 8.0 15.0 TRUE FALSE) (set! drawable (car (gimp-image-flatten image))) (gimp-file-save RUN-NONINTERACTIVE image drawable fileout fileout) (gimp-image-delete image)))

Thanks for your help.

John On Jun 15, 2010, at 11:00 AM, John Dey wrote:

Hi List,

I circulated a script yesterday for rounding corners using the above listed script. I got two suggestions for changes but neither resulting in a working script. Is there a list member that would be willing to send me a small working script using "script-fu-round-corners" so I can learn how to use it. Thank you very much.

John

Rob Antonishen
2010-06-15 21:38:39 UTC (over 14 years ago)

script-fu-round-corners

Hi List,

I thought I might tie off this thread by indicating that I now have a working script.  It appears the definition for "script-fu-round-corners" in script-fu console is in error in that the "run-mode" variable indicated is not reflected in the definition of the script.  I removed the RUN-NONINTERACTIVE from my script and I was off and running.  Here is the final script:

I beleive Saul Goode already indicated this is not an error. The calls in the PDB and are correct when calling from a plugin (C or Python).

My understanding is that scheme scripts get their functions wrapped in a PDB wrapper when registered, and can not be called interactively from within scheme. This means you can't call the registered PDB function, but instead have to call the scheme script declaration that was registered.

If you look in the file selection-round.scm you wil see the declaration:

(define (script-fu-selection-rounded-rectangle image drawable radius concave) ...

which is what must be called to access this from within scheme.

When this is registered in the PDB with the following call: (script-fu-register "script-fu-selection-rounded-rectangle" _"Rounded R_ectangle..."
_"Round the corners of the current selection" "Alan Horkan, Sven Neumann" ; authors "Sven Neumann" ; copyright "2004/06/07"
"*"
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-ADJUSTMENT _"Radius (%)" '(50 0 100 1 10 0 0) SF-TOGGLE _"Concave" FALSE
)

It ends up existing with the additional run-mode parameter in front.

-Rob A>