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

gimp-drawable-type doesn't work on images?

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.

6 of 6 messages available
Toggle history

Please log in to manage your subscriptions.

gimp-drawable-type doesn't work on images? Roland Roberts 05 Sep 17:52
  gimp-drawable-type doesn't work on images? Simon Budig 05 Sep 17:59
   gimp-drawable-type doesn't work on images? Roland Roberts 05 Sep 19:58
    gimp-drawable-type doesn't work on images? Simon Budig 05 Sep 23:02
     gimp-drawable-type doesn't work on images? Roland Roberts 05 Sep 23:49
   gimp-drawable-type doesn't work on images? Roland Roberts 05 Sep 20:00
Roland Roberts
2002-09-05 17:52:39 UTC (over 21 years ago)

gimp-drawable-type doesn't work on images?

I'm still a newbie at this so I'm a bit confused.... I realize that drawables include both images and layers and that they are not interchangeable. I'm confused by this error message from a call to gimp-drawable-type in a Script-Fu:

Script-Fu Error while executing (script-fu-astro-rescale-for-web 5 '(640)) ERROR: Procedural database executing failed: (gimp_drawable_type 5)

Image 5 is an RGB image and I was expecting it to return 0. Does gimp-drawable-type really only work on layers or is this a bug? This is GIMP 1.2.1.

roland

Simon Budig
2002-09-05 17:59:47 UTC (over 21 years ago)

gimp-drawable-type doesn't work on images?

Roland Roberts (roland@astrofoto.org) wrote:

I'm still a newbie at this so I'm a bit confused.... I realize that drawables include both images and layers and that they are not interchangeable. I'm confused by this error message from a call to gimp-drawable-type in a Script-Fu:

Script-Fu Error while executing (script-fu-astro-rescale-for-web 5 '(640)) ERROR: Procedural database executing failed: (gimp_drawable_type 5)

Image 5 is an RGB image and I was expecting it to return 0. Does gimp-drawable-type really only work on layers or is this a bug? This is GIMP 1.2.1.

Images are *not* drawables. Images are drawable containers. Only Layers, Channels (and Selections which are kind of special case of channels) are drawables.

I have not yet checked the problem you mentioned in your other Mail, it might very well be a bug. Have you tried clicking on the image selector? Does the problem persist then?

However, you can easily avoid this problem by moving the menu entry to /foo/bar/baz and registering your script with a SF_IMAGE and a SF_DRAWABLE as the first two arguments. Then you have easily access to the image the user invoked the script in and the current active drawable of this image.

Bye, Simon

Roland Roberts
2002-09-05 19:58:15 UTC (over 21 years ago)

gimp-drawable-type doesn't work on images?

"Simon" == Simon Budig writes:

Simon> Images are *not* drawables. Images are drawable containers. Simon> Only Layers, Channels (and Selections which are kind of Simon> special case of channels) are drawables.

Okay, then how does one determine the type of an image? Do I have to iterate over the layers to find the type? Can an image have layers which are of different types than the parent (e.g., a grayscale layer in an RGB image)?

roland

Roland Roberts
2002-09-05 20:00:09 UTC (over 21 years ago)

gimp-drawable-type doesn't work on images?

"Simon" == Simon Budig writes:

Simon> I have not yet checked the problem you mentioned in your Simon> other Mail, it might very well be a bug. [...]

Simon> However, you can easily avoid this problem by moving the Simon> menu entry to /foo/bar/baz and registering your Simon> script with a SF_IMAGE and a SF_DRAWABLE as the first two Simon> arguments. Then you have easily access to the image the Simon> user invoked the script in and the current active drawable Simon> of this image.

Yes, I could do that, but I think that will confuse the interface since I do not wish to copy only a particular drawable; I want to copy the entire image. On the other hand, the only person likely to be using this for the foreseeable future is me....

roland

Simon Budig
2002-09-05 23:02:09 UTC (over 21 years ago)

gimp-drawable-type doesn't work on images?

Roland Roberts (roland@astrofoto.org) wrote:

"Simon" == Simon Budig writes:

Simon> Images are *not* drawables. Images are drawable containers. Simon> Only Layers, Channels (and Selections which are kind of Simon> special case of channels) are drawables.

Okay, then how does one determine the type of an image? Do I have to iterate over the layers to find the type? Can an image have layers which are of different types than the parent (e.g., a grayscale layer in an RGB image)?

No, the layer types have to be consistent (with the notable exception, that the bottommost layer might not have an alpha channel, all the layers on top of it have to have an alphachannel).

You can determine the global image type via (gimp-image-base-type ...) but be aware that the the values returned are not compatible with the values returned by gimp-drawable-type.

Bye, Simon

Roland Roberts
2002-09-05 23:49:12 UTC (over 21 years ago)

gimp-drawable-type doesn't work on images?

"Simon" == Simon Budig writes:

Simon> You can determine the global image type via Simon> (gimp-image-base-type ...) but be aware that the the Simon> values returned are not compatible with the values returned Simon> by gimp-drawable-type.

Thanks, I thought I had searched the the PDB for "type" but I guess not or I would have found that. (gimp-image-base-type ...) is exactly what I need.

roland