Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
scriptfu could says what values to be expected
#1
scriptfu could says what values to be expected instead of saying only
"Error: Invalid value for argument 1"
Moreover it can provide an example how to set the arguments in a variable.
eg. (file-webp-export  1 0 0 0 a.jpg b.jpg) can save a as b with these numberd arguments means ...  


How to export all my jpg images as webp using gimp in linux bash in batch?

gimp -i  -b '(let* ((image (car (gimp-file-load RUN-NONINTERACTIVE "DSC_0978.JPG"))))(file-webp-export RUN-NONINTERACTIVE image "DSC_0978.webp" lossless include-exif include-xmp))' --batch-interpreter="plug-in-script-fu-eval"

I cant understand what arguments must put in which positions. Script fu menu for file-webp-export has a lot! Whcih of these are essential and in what positions?

When using
Code:
gimp -i  -b '(let* ((image (car (gimp-file-load RUN-NONINTERACTIVE "DSC_0978.JPG"))))(file-webp-export RUN-NONINTERACTIVE image "DSC_0978.webp"))' --batch-interpreter="plug-in-script-fu-eval"


it says
Code:
(script-fu:457680): scriptfu-WARNING **: 14:16:06.586: Missing arg type: GimpExportOptions
(script-fu:457680): scriptfu-WARNING **: 14:16:06.586: Calling Plug-In PDB procedures with arguments as an ordered list is deprecated.
Please use named arguments: (file-webp-export #:run-mode 1 #:image 1 #:file DSC_0978.webp)
batch command executed successfully


but when using
Code:
gimp -i  -b '(let* ((image (car (gimp-file-load RUN-NONINTERACTIVE "DSC_0978.JPG"))))(file-webp-export run-mode "1" image "DSC_0978.webp" 100))' --batch-interpreter="plug-in-script-fu-eval"

it says
Code:
 batch command experienced an execution error:
Error: eval: unbound variable: run-mode
Stopping at failing batch command [0]: (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE "DSC_0978.JPG"))))(file-webp-export run-mode "1" image "DSC_0978.webp" 100))
Reply
#2
An API is not means for human beings, it is meant for programmers. In the script-fu console, hit the Browse... button, the search webp, click on the API on the left, and the doc appears on the right...

However from the message "Calling Plug-In PDB procedures with arguments as an ordered list is deprecated." it seems you are using Gimp3, so you may want to read this. In which case AFAIK you can skip all non-essential arguments and it will use defaults.

Last, I don't know why you want to use Gimp for this if you are on Linux. Just install ImageMagick (available in all distros), and then in a shell script it can be as simple as:

Code:
convert foo.jpg foo.webp

or on recent versions
Code:
magick foo.jpg foo.webp

Most operations you want to do in batch can be done with ImageMagick. For instance I have this line in a script to generate a low-resolution image of my photos. It adds some contrast (-modulate), scales (-geometry), and sharpens a bit.

Code:
convert "$f" -modulate 100,120  -geometry ${size}x${size} -sharpen 0x1.0 -quality $quality "$out"
Reply
#3
@estatistics
Just a suggestion, a front end for IM converseen
https://converseen.fasterland.net/
Reply


Forum Jump: