1 ;Converts image files to .tga
2 ;In: FilesIn (wildcard * possible)
3 ; Compress (using RLE algorithm, 0=no, 1=yes)
4 ;Out: tga files with same name as input (overwrites tga input files)
6 (define (all2tga filesIn compress)
9 (fileList (cadr (file-glob filesIn 1)))
12 (while (not (null? fileList))
16 (image (car (gimp-file-load 1 file file)))
17 (drawable (car (gimp-image-get-active-layer image)))
20 ;Set extension to .tga
21 (set! file (car (strbreakup file ".")))
22 (set! file (string-append file ".tga"))
24 ;Save image as RLE compressed tga
25 (set! drawable (car (gimp-image-merge-visible-layers image 1)))
26 (file-tga-save 1 image drawable file file compress 0)
27 (gimp-image-delete image)
29 (set! fileList (cdr fileList))