I can't get any GIMP Fu script to work (using Gimp 2.10.32 (Revision 1) on Windows 10 Pro 21H2 19044.1826).
Consider this minimal script. It is supposed to read a file and write it out again under a different name, without applying any modifications: (Source: https://superuser.com/a/1558320/1130040)
(define
(mytest in_filename out_filename)
(let* (
(image (car (gimp-file-load RUN-NONINTERACTIVE in_filename in_filename)))
(drawable (car (gimp-image-get-active-layer image))))
(gimp-file-save RUN-NONINTERACTIVE image drawable out_filename out_filename)
(gimp-image-delete image)
)
)
While testing, I also added a 'script-fu-register' block that let's me check in GIMP's procedure browser that the script was detected and loaded without errors. Thus, also the location of the script is correct, as well as the set script paths under options.
(script-fu-register "mytest"
""
_"Test"
""
""
"2022/07/16"
""
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
)
To start the script, 'cd' to the directory (which is %userprofile%\pictures) containing the source image 'p.jpeg' and invoke:
"C:\Program Files\GIMP 2\bin\gimp-2.10.exe" -idf -b '(mytest p.jpeg p1.jpeg)' -b '(gimp-quit 0)' --verbose
I am expecting 'p1.jpeg' being an exact copy of 'p.jpeg' to be written out in the same directory.
What happens: A protocol window opens, containing:
(...)
Starting extension: 'extension-script-fu'
No batch interpreter specified, using the default 'plug-in-script-fu-eval'.
batch command executed successfully
batch command executed successfully
Then it stays open. No error messages. But no output file either.
If I missspell the function name 'mytest' or pass a non-existing file name as the first argument (something.jpeg), I won't receive an error message.
I got rid of the message 'No batch interpreter specified' by adding --batch-interpreter plug-in-script-fu-eval
.
I tried:
- reinstalled Gimp
- alternativly on a clean Windows 11 Pro 21H2 22000.795
- different directories for the source/dest. image file
- different image formats (.png, .jpeg) and files
- command window as elevated admin and as normal user
- a different script (https://opensource.com/article/21/1/gimp-scripting)
- with and without the block 'script-fu-register'
- file parameter with and without quotation marks, full path
- executing all commands from the command line using
-b '(let* ((image (car (gimp-file-load RUN-NONINTERACTIVE p.jpeg p.jpeg)))(drawable (car (gimp-image-get-active-layer image))))(gimp-file-save RUN-NONINTERACTIVE image drawable p1.jpeg p1.jpeg)(gimp-image-delete image))'