Fábio Sato <[EMAIL PROTECTED]> writes:

> I can use a script to open the images and call another one to do the
> dirty job, passing the references to the images and to the drawables
> (like you mentioned). So my problem is this: how can I open a file
> (within a script) and get a reference to the background layer ?

Something like this should work (untested):

(define (my-get-background-layer image)
    (let ((layers (cadr (gimp-image-get-layers image))))
      (aref layers (- (length layers) 1))))

(define (do-something)
  (let* ((image (car (gimp-file-load 0 "/home/ingo/images/nasa.xcf" "nasa.xcf")))
         (background-layer (my-get-background-layer image)))
ICQ: 59461927                                    http://pingus.seul.org | 
Ingo Ruhnke <[EMAIL PROTECTED]>             http://home.pages.de/~grumbel/ |

Reply via email to