Ниже пакетная обработка изображений (ваял пару минут). Что может быть проще?
(define (resize-all pattern)
(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)))
(image-h 0)
(image-w 0)
(scale 1.0)
(min 100)
)
(set! image-h (car (gimp-image-height image)))
(set! image-w (car (gimp-image-width image)))
(plug-in-unsharp-mask RUN-NONINTERACTIVE image drawable 5.0 0.5 0)
(set! image-h (- image-h 30))
(gimp-image-resize image image-w image-h 0 0)
(gimp-layer-resize-to-image-size drawable)
(if (< image-w image-h)
(cond (
(set! scale (/ image-w min))
(set! image-w min)
(set! image-h (/ image-h scale))
))
(cond (
(set! scale (/ image-h min))
(set! image-h min)
(set! image-w (/ image-w scale))
))
)
(gimp-image-scale image image-w image-h)
(gimp-layer-scale drawable image-w image-h FALSE)
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
(gimp-image-delete image)
)
(set! filelist (cdr filelist))
)
)
)