Thanks, I got it working with gimp-layer-new-from-drawable :
I'll probably go for python later, but I didn't understood whether I had to install pygimp or pgimp or something and rather to investigate I figured it was a good opportunity to give a try to Lisp/Scheme.
PS : Ofnuts, I think you were actually (already) the good Samaritan in the two mentioned threads…
Code:
(define (foobar filename)
(let* (
; open image to add
(inputfile (car (gimp-file-load RUN-NONINTERACTIVE filename filename)))
(picture (car (gimp-image-get-active-layer inputfile)))
; open file to insert image into
(template (car (gimp-file-load RUN-NONINTERACTIVE "template.xcf" "template.xcf")))
; duplicate picture into template as new layer
(layer (car (gimp-layer-new-from-drawable picture template)))
)
; add picture to template
(gimp-image-insert-layer template layer 0 -1)
; flatten image
(gimp-image-flatten template)
(file-jpeg-save RUN-NONINTERACTIVE template (car (gimp-image-get-active-drawable template)) "outfile.jpg" "outfile.jpg" 0.95 0.95 1 1 "" 2 1 0 2)
)
)
I'll probably go for python later, but I didn't understood whether I had to install pygimp or pgimp or something and rather to investigate I figured it was a good opportunity to give a try to Lisp/Scheme.
PS : Ofnuts, I think you were actually (already) the good Samaritan in the two mentioned threads…