Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
此脚本在 if 语句处失败,并显示“错误:(:1)>:参数 2 必须是:数字”,为什么?
(define x 1500) (if(> x (gimp-image-width image)) (set! x (gimp-image-width image)) )
关于 GIMP 中使用的 Scheme 版本有什么好的参考吗?
当您在 script-fu 控制台中尝试时,它会gimp-image-width返回一个列表而不是数字:
gimp-image-width
(gimp-image-width 1) (400)
所以你必须提取列表的元素:
(define x 1500) (if(> x (car (gimp-image-width 1))) (set! x (gimp-image-width 1)) )
附带说明一下,如果您开始编写 Gimp 脚本,请使用 Python,它会容易得多:
width=min(1500,image.width)