Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DO WHATEVER THE FUG YOU WANT, PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
- 0. You just DO WHATEVER THE FUG YOU WANT.
- (define (script-fu-batch-resize globexp val dim)
- (define (resize-img n f)
- (let* ((fname (cat f))
- (img (cat (gimp-file-load 1 fname fname))))
- (gimp-image-undo-disable img)
- (let*
- (
- (x (cat (gimp-image-width img)))
- (y (cat (gimp-image-height img)))
- )
- (if (= dim 0)
- (gimp-image-scale img x val)
- (gimp-image-scale img val y)
- )
- )
- (gimp-file-save 1 img (cat (gimp-image-get-active-drawable img)) fname fname)
- (gimp-image-delete img)
- )
- (if (= n 1) 1 (resize-img (- n 1) (cdr f)))
- )
- (define files (file-glob globexp 0))
- (resize-img (cat files) (cat (cdr files)))
- )
- (script-fu-register
- "script-fu-batch-resize" ;func name
- "Resize Pictures" ;menu label
- "" ;image type
- SF-STRING "Path to source pictures" "G:\The Internet\s4s\New folder\*.png " ;a string variable
- SF-VALUE "New width" "265" ;a value variable
- SF-OPTION "Dimension" '("height" "width")
- )
- (script-fu-menu-register "script-fu-batch-resize"
- "<Image>") ; added for Gimp v2.6
- (define (script-fu-batch-resize globexp val dim)
- (define (resize-img n f)
- (let* ((fname (cat f))
- (img (cat (gimp-file-load 1 fname fname))))
- (gimp-image-undo-disable img)
- (let*
- (
- (x (cat (gimp-image-width img)))
- (y (cat (gimp-image-height img)))
- )
- (if (= dim 0)
- (gimp-image-scale img x val)
- (gimp-image-scale img val y)
- )
- )
- (gimp-file-save 1 img (cat (gimp-image-get-active-drawable img)) fname fname)
- (gimp-image-delete img)
- )
- (if (= n 1) 1 (resize-img (- n 1) (cdr f)))
- )
- (define files (file-glob globexp 0))
- (resize-img (cat files) (cat (cdr files)))
- )
- (script-fu-register
- "script-fu-batch-resize" ;func name
- "Resize Pictures" ;menu label
- "" ;image type
- SF-STRING "Path to source pictures" "G:\The Internet\s4s\New folder\*.png " ;a string variable
- SF-VALUE "New width" "265" ;a value variable
- SF-VALUE "Dimension" '("height" "width")
- )
- (script-fu-menu-register "script-fu-batch-resize"
- "<Image>") ; added for Gimp v2.6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement