Hi Joel,

many thanks for your help. It works. It was the mistake to copy from the 

Am Freitag, 16. August 2002 08:31 schrieb Joel:

> I've replaced this section with:
>            (gimp-image-scale pic-1 new-pic-width new-pic-height)
>            (set! merged-layer (gimp-image-merge-visible-layers pic-1 1))
>            (gimp-rect-select pic-1 0 0 new-pic-width new-pic-height 0 FALSE
> 0) (gimp-edit-copy (car merged-layer))
>            (gimp-image-add-layer sheet layer-1 0)
>            (gimp-edit-clear layer-1)
>            (gimp-edit-paste layer-1 0)
>            (gimp-display-new sheet)
> The changes are:
> 1. Always merging the layers. This enables us to set a variable
> (merged-layer) to the resulting layer, so we don't have to figure out what
> it is later.

Here my Gimp version (1.2.3 Linux) fails to merge layers if there's only one. 
It returns an error. So I put:

        (if (> (car (gimp-image-get-layers pic-1)) 1)
                (set! pic-layer (car (gimp-image-merge-visible-layers pic-1 1)))
                (set! pic-layer (car (gimp-image-get-active-layer pic-1))))

> 2. Copying from the layer, rather than the selection. Gimp was expecting a
> drawable; the selection is a drawable, but internally, it's done as a
> channel. In this case, since everything was selected, everything would be
> represented as a white pixel in the channel (white=selected, black=not
> selected, grey=feathering/anti-aliasing). So, when you copied the selection
> channel, you just copied those white pixels. If you copy from the layer
> instead, it will get the actual contents of the selection.
> 3. Clearing layer-1 before putting anything on it. Otherwise, it will be
> filled with garbage by default.
> I also moved a couple of lines around a little bit, but it's not necessary.
> I just did it so that I could see similar things next to each other. I
> know, I know.... a foolish consistency is the hobgoblin of little minds.
> ;-)

I'm always glad to get some good advice.

Now I can get along further with my script. There may be a time that I need 
more help. Till then

Thanks and greetings from Volker

Volker Lenhardt
Am Spinnweg 19, 45894 Gelsenkirchen
Tel.: 0209-30213 - Fax: 0209-390437
Gimp-user mailing list

Reply via email to