我嘗試使用gimp 2.8來編寫腳本。script-fu腳本無法在gimp 2.0下載入圖像
我在程序瀏覽器中看不到script-fu-register)。
我嘗試用RUN-INTERACTIVE和運行非交互...這個腳本運行:
(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,對這個小錯誤抱歉。 –