我有很多大约 100 张的图像,我需要使用缩放因子调整所有图像的大小。但是,当我运行脚本时,它向我显示以下错误
Error: ( : 22091) >: argument 1 must be: number
我不是 Script-Fu 方面的专家,所以我找不到任何可以帮助我的资源。以下是我的脚本,任何帮助将不胜感激。
(define (batch-resize pattern scaleFactor)
(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)))
(imageWidth) (gimp-image-width image)
(imageHeight) (gimp-image-height image))
(let * ((imageFactor 1))
(if (> imageWidth imageHeight)
((set! imageFactor (/ imageWidth scaleFactor))) ((set! imageFactor (/ imageHeight scaleFactor))))
(set! imageWidth (/ imageWidth imageFactor))
(set! imageHeight (/ imageHeight imageFactor)))
(gimp-image-scale-full image imageWidth imageHeight INTERPOLATION-CUBIC)
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image))
(set! filelist (cdr filelist)))))