Hi list,
I've done a scripts that builds an calender and colours the days with
different colours depending on the status of the day. I've got 6 colours
and one to just fill out so the month starts with the correct day, ie
i've got 6 * 31 + 1 = 187 images and each is about 70 bytes so a
calender is 6 times 7 of these little sqaures, about 3k.
Now this little script handling this tiny amount of data runs amok and
grows and grows untill i restart apache brutaly, I guess I've done
something very wrong but I can't figure out what, nor can I find any
info about this. Here's what the program looks like:
my $image_obj = Image::Magick->new;
my $images = $image_obj->Read (@days); # an array with 49 filnames
my $montage = $image_obj->Montage (
mode => 'Concatenate',
background =>'#ffffff',
tile => '7x7',
frame => '1x1',
gravity => 'center',
);
$montage->Crop ('138x118'); #fixing the size
print "Content-Type: image/gif\n\n" ;
$montage->Write();# the image doesn't come out out unless i use Write
before
print $montage->ImageToBlob();
undef $montage;
undef $images;
undef $image_obj;
Anyone see any obvious mistakes?
I also tried putting this before the undef's but it didn't do any
difference:
for (my $i = 0; $i <= 48; $i++)
{
undef $image_obj->[$i];
}
/Jon