# the gimp script (define (img2img in_filename out_filename) (let* ( (image (car (gimp-file-load RUN-NONINTERACTIVE in_filename in_filename))) (layer (gimp-image-flatten image)) (drawable (car (gimp-image-get-active-layer image))) ) (gimp-file-save RUN-NONINTERACTIVE image drawable out_filename out_filename) (gimp-image-delete image) ) ) ############################################ # bash script #!/bin/bash COMMAND=`basename $0 .sh` case "$#" in 2) ;; *) echo -e "$COMMAND: script for transforming a image with gimp from exts" echo -e "usage:\n\t$COMMAND in_filename out_filename\n" exit 1 esac gimp --as-new -dfs -i -b "'(img2img \"$1\" \"$2\")'" -b "'(gimp-quit 0)'" ############################################ # the gimp script called directly from a shell $ gimp --as-new -dfs -i -b '(img2img "ATSP-A0min.png" "prueba.eps")' -b '(gimp-quit 1)' batch command executed successfully $ # the script terminate and generate the file prueba.eps as expected ############################################ # the gimp script called through the bash script $ img2img "ATSP-A0min.png" "prueba.eps" batch command executed successfully batch command executed successfully ^C/usr/lib/gimp/2.0/plug-ins/script-fu terminated: Interrupción gimp: terminated: Interrupción [gimp never return] ############################################ # the gimp script called through source $ source ~/src/bin/img2img.sh ATSP-A0min.png prueba.eps batch command executed successfully batch command executed successfully ^C/usr/lib/gimp/2.0/plug-ins/script-fu terminated: Interrupción gimp: terminated: Interrupción [gimp never return]