houghi <houghi@[EMAIL PROTECTED]
> wrote:
>Floyd L. Davidson wrote:
>> houghi <houghi@[EMAIL PROTECTED]
> wrote:
>>>I got as far as the following:
>>>gimp -i -d -b "(script-fu-fuzzy-border \"foo.png\" RUN-NONINTERACTIVE
>>>\'(100;100;100) 100 0 16 0 0 0 1)" -b '(gimp-quit 0)'
>>> batch command: executed successfully.
><snip>
>
>> You are using the batch mode to execute a scheme script
>> that operates on a previously loaded image. The scheme
>> script was written be a menu option available for
>> interactive users, and does nothing to load such an
>> image. Note that "foo.png" is not an image, it is a
>> *file*, and the "script-fu-fuzzy-border" function
>> requires an image for the first argument. (I can't
>> relate argument list in the example command above to the
>> argument list required by script-fu-fuzzy-border.)
>
>So what you are saying is that it won't work. Bit strange, because other
>things that I do that way WILL work.
That simply *cannot* be true. Your argument list has
nothing to do with the require arguments of the function
you are calling. And there is no code in that function to
load an image from a file.
It *cannot* work.
>> To use the "script-fu-fuzzy-border" function in batch
>> mode you need to first execute the required gimp
>> functions to load an image by reading one from a file.
>
>OK and how do I do that?
You have to *read* the rest of the article you are
responding to one line at a time, multiple times if
necessary, until you *understand* the entire article.
Do that *before* asking stupid questions about each line
that are answered on the next line or in the next
paragraph.
>I think the sample script is lousy for learning. I have read it many
>times over the years and I have not learned anything.
What can anyone say? Maybe this just isn't something
you are cut out to do. I can't compose music, or even
play it, and if I asked questions like yours of a
composer I'd expect to be told to go do something like
programming...
Maybe you should compose music! :-)
Here's the script you need to batch process fuzzy borders.
; batchfuzzy.scm
;
; Apply script-fu-fuzzy-border as a batch process.
;
; Batchfuzzy is copyright 2008 by Floyd L. Davidson, floyd@[EMAIL PROTECTED]
Script-fu-fuzzy-border is defined in fuzzyborder.scm, which is
; copyright by Chris Gutteridge, cjg@[EMAIL PROTECTED]
This file should be placed in directory ~/.gimp-2.4/scripts with
; a filename that ends with ".scm".
;
; GIMP is then called from the command line to process all files
; that fit the specified pattern. Command line syntax is:
;
; gimp -i -c -d -b '(batch_fuzzy_border "pattern" "color" \
; border_size toggle_blur granularity \
; toggle_shadow percent_shadow)' -b '(gimp-quit 0)'
;
; "pattern" : a regular expression pattern specifying files
; (example: "*.jpg")
;
; "color" : color of the border
; (example: "pink")
;
; border_size : border size in pixels
; (example: 20)
;
; toggle_blur : blur toggle, 1/0 or TRUE/FALSE
; (example: TRUE)
;
; granularity : granularity, 1 or more where 1 is low
; (example: 4)
;
; toggle_shadow : toggle shadow, 1/0 or TRUE/FALSE
; (example: TRUE)
;
; percent_shadow: percent of border that is shadowed
; (example: 75)
;
; A typical example of a command line to invoke this program is:
;
; gimp -i -c -d -b '(batch_fuzzy_border "*.jpg" "pink" 40 \
; TRUE 10 TRUE 50 )' -b '(gimp-quit 0)'
;
;
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
(define (batch_fuzzy_border pattern
color
size
blurt
gran
shadowt
shadowp)
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(let* ((filename (car filelist))
(image (car (gimp-file-load RUN-NONINTERACTIVE
filename filename)))
(drawable (car (gimp-image-get-active-layer image))))
(script-fu-fuzzy-border image drawable color size blurt
gran shadowt shadowp FALSE TRUE)
(set! drawable (car (gimp-image-get-active-layer image)))
(gimp-file-save RUN-NONINTERACTIVE image drawable filename
filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))
;
; End of batchfuzzy.scm file.
--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@[EMAIL PROTECTED]


|