I can't seem to write a script that uses file-header-save to output a C style header from a png with Gimp 2.10 on Windows.
I can export a png to a C header file from GIMP through File -> Export As... and Select File Type (By Extension) C source code header.
Pre-Testing
From https://www.gimp.org/tutorials/Basic_Batch/ I created a script called firstTest.scm
(define (simple-unsharp-mask filename radius amount threshold)
(let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(drawable (car (gimp-image-get-active-layer image))))
(plug-in-unsharp-mask RUN-NONINTERACTIVE image drawable radius amount threshold)
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image)))
In a directory, I have a file BLAH.png. From a command prompt I run
"c:\Program Files\GIMP 2\bin\gimp-2.10.exe" --verbose -i -b "(simple-unsharp-mask \"BLAH.png\" 5.0 0.5 0)" -b "(gimp-quit 0)"
Everything works, and in the middle of the verbose output:
Starting extension: 'extension-script-fu'
No batch interpreter specified, using the default 'plug-in-script-fu-eval'.
using gegl copy
batch command executed successfully
EXIT: gimp_exit
EXIT: gimp_real_exit
My Real Issue
I created a script called headerExport.scm:
(define (outputHeader in-filename out-filename)
(let* ((image (car (gimp-file-load RUN-NONINTERACTIVE in-filename in-filename)))
(drawable (car (gimp-image-get-active-layer image))))
(file-header-save RUN-NONINTERACTIVE image drawable out-filename out-filename)
(gimp-image-delete image)))
In a directory, I have a file wifi_30x30.png. From a command prompt I run
"c:\Program Files\GIMP 2\bin\gimp-2.10.exe" -i --verbose -b "(outputHeader \"wifi_30x30.png\" \"OUTPUT.h\")" -b "(gimp-quit 0)"
In the output, I see this:
Starting extension: 'extension-script-fu'
No batch interpreter specified, using the default 'plug-in-script-fu-eval'.
batch command experienced an execution error:
Error: Procedure execution of file-header-save failed
EXIT: gimp_exit
EXIT: gimp_real_exit
Reviewing the Procedure Browser, my arguments match what is called out there.
If I swap file-header-save for gimp-file-save in each script, neither works.
What am I doing wrong?