Marc Lehmann wrote:
> On Sun, May 14, 2000 at 06:55:22AM -0700, Michael Lee <[EMAIL PROTECTED]> wrote:
> > I've been trying to get the following script to work...
> Try to rwrite it using the newer network-api (i.e. like this):
>    use Gimp;
>    use Term::ReadLine;
>    Gimp::init;
>    sub net
>    {
>        $term = new Term::ReadLine;
>        while( defined ($_ = $term->readline("Gimp> ")))
>        {
>            $res = eval($_) . "\n";
>            print("Error: $@"), next if $@;
>            print "\n";
>        }
>    }

Very cool.  I re-read through the Gimp(for perl) man page and it makes
sense.  Thanks for the help.  This will work much better for me than the
net() function (though I might still find use for it).

Now, here's something that may be a gimp bug.

Using the above interface with Gimp::init, I wrote:

use Gimp;
use strict;


# create a new image
my $img = new Image( 100,100,RGB );

# create a layer for the image
#my $layer = new Layer( $img, 100, 100, RGBA_IMAGE, "Hope", 100, 0 );
#$img->add_layer( $layer, -1 );

# give the image a display
Gimp->display_new( $img );

In the above code, display_new() will fail unless I create a layer for
the image.  Of course, one usually creates an image with the intent of
putting a layer in it, so I can work with it.  But it seems to me that I
should be able to add my first layer to the image either before or after
I create a display for it.

As I was experimenting with these scripts, I ended up with quite of few
images with no displays.  I could see them listed in the Layers dialog
but there was no way to get at them and remove them.  I wrote a quick
script that called gimp_image_list and removed them:

my @images = Gimp->image_list;
foreach my $img (@images)
    Gimp->image_delete( $img );

This only deleted the lost ones.  I had 2 with proper displays and they
did not delete.  Were they supposed to or do I need to call
gimp_display_delete to remove the good ones since they have displays? 
It would be nice to be able to clean up lost images from the gimp ui
with options to recover (give it a display) or delete.

Also, at one point in my trials, gimp crashed because of too many
display-less images (i think i had around 10).


Reply via email to