所以我尝试运行本教程中的批处理代码:http://www.gimp.org/tutorials/Basic_Batch/
我将其复制并保存到.gimp-2.8脚本文件夹
(define (batch-unsharp-mask pattern
radius
amount
threshold)
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(let* ((filename (car filelist))
(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))
(set! filelist (cdr filelist)))))
并运行命令:
gimp-2.8 -i -b '(batch-unsharp-mask "*.png" 5.0 0.5 0)' -b '(gimp-quit 0)'
但我得到了错误
Error: ( : 1) eval: unbound variable: *.png
这似乎不是脚本的问题;可能是我称之为的方式,或者我错过了一些东西,但我无法弄明白。
答案 0 :(得分:2)
我知道这已经有四个长的月了,但我只是在用我写过的gimp(2.8)剧本和经常性的剧本进行战斗
batch command experienced an execution error:
Error: ( : 32578) eval: unbound variable: while
事实证明,在我急于整合脚本目录时,我删除了对/usr/share/gimp/2.0/scripts的引用。显然,该目录中的某些内容定义了"而#34;
编辑 - >首选项>文件夹 - >脚本
答案 1 :(得分:1)
让原始脚本在gimp 2.8中运行ubuntu 14.04lts只需要将换行符复制并粘贴在一起。我无法粘贴这个,因此线条没有被破坏,只需删除空行,因为它们是一个发布异常。将脚本放在〜/ .gimp-2.9 / scripts中 用它去除雾霾 以gimp -i -b'运行(batch-unsharp-mask“* .JPG”100 0.3 0)' - b'(gimp-quit 0)'
(define (batch-unsharp-mask pattern radius amount threshold)
(let* ((filelist (cadr (file-glob pattern 1))))
(while (not (null? filelist))
(let* ((filename (car filelist))
(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))
(set! filelist (cdr filelist)))))
答案 2 :(得分:0)
I resolved this error by confirming the name of my script. I copied my script from an existing script and the name was duplicate. After I updated the name of my script the error went away and everything started working.
You must have unique script names, that includes the define
name
答案 3 :(得分:0)
帮助我确保脚本具有正确的扩展名 .scm
。