RSS/Atom feed Twitter
Site is read-only, email is disabled

(gimp-image-add-layer)?

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

(gimp-image-add-layer)? Douglas Lewan 07 Jun 22:47
  (gimp-image-add-layer)? Helvetix Victorinox 08 Jun 04:39
Douglas Lewan
2003-06-07 22:47:54 UTC (over 21 years ago)

(gimp-image-add-layer)?

All,

I've just started hacking in the Gimp via scheme and clearly don't understand (gimp-image-add-layer).

What I've read suggests that the following ought to get me a new layer in an image.

=> (set! the-image-id (car (gimp-image-new 10 10 GRAY_IMAGE)))

0 => (set! the-layer-id (car (gimp-layer-new the-image-id 10 10 GRAY_IMAGE "a named layer" 100 NORMAL)))

2 => (gimp-image-add-layer the-image-id the-layer-id -1)

ERROR: Procedural database execution failed: (gimp_image_add_layer 0 2 -1)

A "procedural database execution failure" suggests that something quite fundamental is going on. (It's not just me getting types or syntax confused.)

Can anyone help? Can anyone tell me how I might investigate this intelligently?

Thanks.

Helvetix Victorinox
2003-06-08 04:39:52 UTC (over 21 years ago)

(gimp-image-add-layer)?

You need to say something like:

(set! the-image-id (car (gimp-image-new 10 10 GRAY))) (set! the-layer-id (car (gimp-layer-new the-image-id 10 10 GRAYA_IMAGE "a named layer" 100 NORMAL))) (gimp-image-add-layer the-image-id the-layer-id -1)

In my opinion the PDB documentation isn't helpful in this case, because the mnemonics are wrong, but paying close attention to the details will show you what went bad:

The value of GRAY_IMAGE (which you're using in gimp-image-new) is 2, which corresponds to an image type of GIMP_INDEXED -- which is obviously not what you wanted. Then when you tried to add the, correctly created, layer, it complained.

Helvetix

On Sat, Jun 07, 2003 at 04:47:54PM -0400, Douglas Lewan wrote:

All,

I've just started hacking in the Gimp via scheme and clearly don't understand (gimp-image-add-layer).

What I've read suggests that the following ought to get me a new layer in an image.

=> (set! the-image-id (car (gimp-image-new 10 10 GRAY_IMAGE)))

0 => (set! the-layer-id (car (gimp-layer-new the-image-id 10 10 GRAY_IMAGE "a named layer" 100 NORMAL)))

2
=> (gimp-image-add-layer the-image-id the-layer-id -1)

ERROR: Procedural database execution failed: (gimp_image_add_layer 0 2 -1)

A "procedural database execution failure" suggests that something quite fundamental is going on. (It's not just me getting types or syntax confused.)

Can anyone help? Can anyone tell me how I might investigate this intelligently?

Thanks.