RSS/Atom feed Twitter
Site is read-only, email is disabled

file-header-save appears to not work

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

file-header-save appears to not work bizaff 18 Nov 18:25
  file-header-save appears to not work rich404 20 Nov 15:22
2020-11-18 18:25:51 UTC (over 3 years ago)
postings
1

file-header-save appears to not work

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?

2020-11-20 15:22:22 UTC (over 3 years ago)
postings
40

file-header-save appears to not work

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.

....snip....

There is very little activity on this forum these days, you should ask on gimp-forum.net or gimpchat.com or gimplearn.net each has a scripts/plugins section.