10

所以我尝试运行本教程中的批处理代码: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

这似乎不是脚本的问题;可能是我称呼它的方式,或者我错过了一些东西,但我无法弄清楚。

4

4 回答 4

3

我知道这已经是四个月了,但我只是在与我编写的一个 gimp (2.8) 脚本作斗争,并得到一个反复出现的

batch command experienced an execution error:
Error: ( : 32578) eval: unbound variable: while 

事实证明,在我匆忙合并脚本目录时,我删除了对 /usr/share/gimp/2.0/scripts 的引用。显然该目录中有一些东西定义了“while”

编辑->首选项->文件夹->脚本

于 2014-07-06T17:39:36.777 回答
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)))))
于 2015-04-28T22:52:05.157 回答
0

我通过确认我的脚本名称解决了这个错误。我从现有脚本中复制了我的脚本,但名称重复。在我更新脚本的名称后,错误消失了,一切都开始工作了。

您必须具有唯一的脚本名称,其中包括define名称

于 2018-03-25T20:15:31.640 回答
0

帮助我的是确保脚本具有正确的扩展名,.scm.

于 2021-05-10T01:48:52.793 回答