Hello-
I am working on some cgi scripts that make use of the Gimp Perl Module
and Perl-Server.
So far so good, I have been able to generate images through the cgi,
using the same Gimp instance.
I have noticed though that in some cases the memory for the Gimp
instance continues to grow in size, even if I delete the image. For
example, here's an excerpt of a test script:
Gimp::init;
Gimp::lock();
Gimp::set_trace(TRACE_ALL);
my $outfile = "path to outfile... /gimp_test.gif"; my $img =
gimp_image_new(300, 200, 0);
$img->gimp_image_undo_disable;
my $layer = gimp_layer_new($img, 300,200,RGB, "Layer 1", 100,
NORMAL_MODE); gimp_image_add_layer($img, $layer, -1);
Palette->set_foreground([0, 0, 0]);
gimp_palette_set_background([255,255,255]);
gimp_edit_fill($layer, BACKGROUND_FILL);
###################################################
## when these two lines are commented out ## gimp instance does not keep
grabbing more memory
my $text_layer = gimp_text_fontname($img,-1,0,0,"Testing testing", 0,
0, 14, 0, "Verdana Italic");
gimp_image_merge_down($img, $text_layer, CLIP_TO_BOTTOM_LAYER);
###################################################
Gimp->perl_fu_webify($img, -1,0,0,[0, 0, 0],0,256,0); file_save($img,
Gimp->-1, $outfile, $outfile);
$img->gimp_image_undo_enable;
gimp_image_delete($img);
Gimp::unlock();
Gimp::end;
I see that when I do not call the gimp_text_fontname function I don't
have any noticeable memory issues regardless of how many times I call
the script. My feeling is that the gimp_text_fontname is creating a
resource that is not deleted with the image and that I am unable to mark
for destruction (I have tried various functions for removing, attaching,
deleting the layer returned by gimp_text_fontname but it does not seem
to have any effect).
I am using GIMP version 2.0.1. If anyone has run into the same issues
with gimp_text_fontname and has an idea of the best way to clean up
resources after using it (or if I am on the wrong track here), it would
be greatly appreciated.
Thanks in advance,
Jared
_________