【问题标题】:script-fu script not load image under gimp 2.0script-fu 脚本在 gimp 2.0 下不加载图像
【发布时间】:2013-07-21 13:07:51
【问题描述】:

我尝试使用 gimp 2.8 来处理这个脚本。

我在过程浏览器中没有看到 script-fu-register)。

我尝试使用 RUN-INTERACTIVE 和 RUN-NONINTERACTIVE 运行...这个脚本:

 (define (script-fu-cut-height filename outputfilename myheight)
 (let* (
  (img (myimage (gimp-file-load RUN-INTERACTIVE filename filename)))
  (imagewidth (myimage (gimp-image-width img)))
  (imageheight (myimage (gimp-image-height img)))
  (width (- imagewidth (+ right left)))
  (height (- myheight (+ top bottom)))
  )
  (gimp-image-crop img width height left top)
  (gimp-png-save RUN-INTERACTIVE
    img
    (myimage (gimp-image-active-drawable img))
    outputfilename
    outputfilename)
 (gimp-image-delete img)
 ))

 (script-fu-register "script-fu-cut-height"
 "www.free-tutorials.org : script-fu"
 "Cut an image by height and let width default"
 "test"
 "www.free-tutorials.org"
 "Jul 2013"
 "RGB* GRAY*"
 SF-STRING "Filename" ""
 SF-STRING "OutputFilename" ""
 SF-VALUE "TopEdge" "0"
 SF-VALUE "RightEdge" "0"
 SF-VALUE "BottomEdge" "0"
 SF-VALUE "LeftEdge" "0"
 )
 script-fu-cut-height()

我用它来运行它:

$ gimp -i -c -b "(script-fu-cut-height \"test-script-fu.png\" \"out-script-fu-output.png\" 85)" -b  "(gimp-quit 0)"

它在用户主文件夹中的图像。

我得到的错误:

~$ gimp -i -c -b "(script-fu-cut-height \"test-script-fu.png\" \"out-script-fu-       output.png\" 85)" -b  "(gimp-quit 0)"
Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 103: Having     multiple values in <test> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 138: Having     multiple values in <test> isn't supported and may not work as expected
batch command experienced an execution error:
Error: (<unknown> : 136051114) eval: unbound variable: myimage 

Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 103: Having multiple values in <test> isn't supported and may not work as expected
Fontconfig warning: "/etc/fonts/conf.d/65-droid-sans-fonts.conf", line 138: Having multiple         values in <test> isn't supported and may not work as expected

【问题讨论】:

  • 标题贴错了,我用的是gimp 2.8,抱歉这个小错误。

标签: gimp script-fu


【解决方案1】:

错误提示“未绑定变量:myimage”。这告诉您您指的是一个名为“myimage”的变量/函数,但您从未定义过该变量,因此它不知道“myimage”代表什么。

你知道“myimage”应该代表什么吗?你是从其他人的脚本中复制的吗?

函数 gimp-file-load 返回一个包含您打开的图像的列表。您需要使用“car”函数从该列表中提取第一个条目,以便将其存储在您的“img”变量中。所以而不是 (img (myimage (gimp-file-load RUN-INTERACTIVE filename filename))) 它应该说 (img (car (gimp-file-load RUN-INTERACTIVE filename filename)))

另外,我认为您可能想改用 RUN-NONINTERACTIVE。

同样,我认为您需要更改彼此的实例 (我的形象……) 成为 (车 ...) 而是。

【讨论】:

  • 谢谢,我也修复了汽车功能,但我得到了这个:script-fu-register:参数类型必须是整数值批处理命令遇到执行错误:错误:(:161757610) eval: unbound variable: right ...我需要更多关于汽车的信息以及如何解决这个问题
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-07-04
  • 1970-01-01
  • 1970-01-01
  • 2019-04-01
  • 1970-01-01
  • 2018-09-30
相关资源
最近更新 更多