I am using this script, which I want to use to load all tga files in a folder, resize their canvas, add border and save:
(let* ((filelist (cadr (file-glob pattern 1)))) (while (not (null? filelist)) ;Load the image (let* ((filename (car filelist)) (image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) (drawable 0) (layer 0)) ;Change canvas size (gimp-image-resize image 360 130 84 13) ;Load border layer above it (set! layer (car(gimp-file-load-layer RUN-NONINTERACTIVE image "E:\\Temp\\border.xcf"))) (gimp-image-insert-layer image layer 0 -1) ; *** *********************** ; 111 (set! drawable (car (gimp-image-flatten image))) ; 222 (set! drawable (car (gimp-image-merge-visible-layers image EXPAND-AS-NECESSARY))) ;Save (gimp-file-save RUN-NONINTERACTIVE image drawable filename filename) (gimp-image-delete image)) (set! filelist (cdr filelist)))))
If I run manually untill the **** line and use the export option in gimp everything works fine.
If I run with the 111 line everything is fine, but instead of the transparent frame I get white area.
If I run with the 222 line everything the transparent are get cropped.
I found this option
(file-tga-save RUN-NONINTERACTIVE image drawable filename filename 1 0)
(gimp-file-save RUN-NONINTERACTIVE image drawable filename filename)
still no change, same result as before.
for illustration purpose here is an image: http://i49.tinypic.com/20f6gdi.jpg i.e. I want to turn surround my tga image with transperant padding
This post has been edited by bugmenot: 02 August 2012 - 07:07 AM