see the following script. It works with GIMP 2.10 but doesn't witch GIMP 3.X.
(
define (brightness-contrast-multi pattern brightness contrast) (
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)))
)
(gimp-image-convert-grayscale image)
(gimp-drawable-brightness-contrast drawable brightness contrast)
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image)
)
(set! filelist (cdr filelist))
)
)
)
I tried to run this script by the following command:
gimp -i --batch-interpreter=plug-in-script-fu-eval -b '(brightness-contrast-multi "*.png" 0 0.75)' -b '(gimp-quit 0)'
and get the error message:
(script-fu:13349): scriptfu-WARNING **: 16:23:40.849: Calling Plug-In PDB procedures with arguments as an ordered list is deprecated. Please use named arguments: (file-glob #:pattern ".png" #:filename-encoding TRUE) batch command experienced an execution error: Error: car: argument 1 must be: pair Stopping at failing batch command [0]: (brightness-contrast-multi ".png" 0 0.75)
So, I changed the script to:
(
define (brightness-contrast-multi pattern brightness contrast) (
let* (
(filelist (cdr (file-glob #:pattern pattern #:filename-encoding TRUE)))
)
(
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)))
)
(gimp-image-convert-grayscale image)
(gimp-drawable-brightness-contrast drawable brightness contrast)
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image)
)
(set! filelist (cdr filelist))
)
)
)
But now, filelist ist null ...
What I am doing wrong? Thanks!