0
以下是我正在嘗試編寫的較大的Script-fu腳本的一部分。Script-fu複製後無法縮放圖像
我遇到了一個問題,試圖複製打開的.xcf文件,然後將其縮放到某個用戶指定的維度。
以下是我雖然會工作內容:
(define (my-duplicate-and-scale inImage inDrawable inWidth inHeight)
(let* ((theDuplicateImage (gimp-image-duplicate inImage)))
(gimp-image-scale theDuplicateImage inWidth inHeight)
)
)
(script-fu-register
"my-duplicate-and-scale" ;func name
"Duplicate and Scale ..." ;menu label
"" ;description
"" ;author
"" ;copyright notice
"" ;date created
"*" ;image type that the script works on
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-VALUE "Width" "512"
SF-VALUE "Height" "512"
)
(script-fu-menu-register "my-duplicate-and-scale" "<Image>/File/My")
當我執行我收到以下錯誤功能:
Error while executing my-duplicate-and-scale:
Error: (: 2) Invalid type for argument 1 to gimp-image-scale
按程序瀏覽器gimp-image-duplicate
返回IMAGE
和第一參數到gimp-image-scale
是IMAGE
。
如果您尚未與方案中使用,也許是更好的交易將是學習Python的腳本:這是一種更爲靈活的語言,但沒有很多捕捉計劃。 – jsbueno