I am currently working on a script-fu to provide previews of the more popular 
plug-ins with varying parameters. The script takes a list of images 
(blur.png, iir.png, rle.png, despeckle.png etc.), applies the respective 
plug-in with varying parameters and writes blur1.png, blur2.png, ..., 
blur(n).png,  iir1.png, iir2.png, ..., iir(m).png etc., along with a file 
that records which filter/parameters were used for which image, for example:

blur1.png: filter Blur Percent 20 Count 5
blur2.png: filter Blur Percent 40 Count 10
iir1.png: filter "Gaussian Blur (IIR)" Radius 3 Horizontal 7 Vertical 5
edge.png: filter Edge Amount 2 "Wrap Mode" SMEAR Algorithm Differential

The thing is: The "print" command ("(print "test")" ) is not working for me in 
batch-mode (Gimp 2.0.2). It does what it should on the Script-FU console, but 
shows no output when used like

gimp -c -i -d -b '(filter-previews)' '(gimp-quit 0)'

A more simple case: When I create this file ("testprint.scm") in 

(define (testprint)
        (print "this is a test"))

and invoke

gimp -c -i -d -b '(testprint)' '(gimp-quit 0)'

I get:

batch command: executed successfully.

(and nothing else)

Is this a bug?

Another question: Can I - in Gimp-scheme - define the C-equivalent to 
variables declared "static" (at global, not procedural, level), that is, 
variables that are global (i.e., visible in all procedures), but only in a 
particular file?

If not, can I declare variables that are *global*? How?

I need this for the mapping of filters <---> respective input-files, for 
example, I could use this:

file_for_blur:  blur.png
file_for_iir: iir.png

I know that I can always use "define", like

(define (blur-file) (set! return "blur.png"))

but that would not (really?) allow constructs like:

file_for_blur: blur.png
file_for_blur: blur_changed_my_mind_use_this_instead_but_keep_other_too.png
file_for_blur: use_yet_another.png

that is, set the variable to a different value on the fly (without the need to 
comment out anything).

Moreover, does there exist reference documentation for basic Gimp-Scheme 
things (tutorials aside), like string-append etc.? Some standard 
Lisp-functions don't seem to be implemented ("nth" for example) Should I add 
some? Which ones?


Gimp-developer mailing list

Reply via email to