Page 1 of 1

Memory leak with Image::annotate in magick++

Posted: 2007-08-23T11:52:03-07:00
by fournij
Hi

I'm using ''ImageMagick-6.3.5-4-Q16-windows-dll.exe", magick++ with Microsoft Visual Studio 2005 and It's a MFC project.

This is a part of my code :

Code: Select all

string input, output, tc;
Image img, logoImg

logoImg.read(m_sLogoPath);

//For all the DPX files I have to convert
for(int j = 0; j <= inputFileList.GetUpperBound(); j++){

   input = inputFileList.GetAt(j);//DPX image - Source
   output = outputFileList.GetAt(j);//TGA image - Destination

   img.read(input);
   img.type(TrueColorMatteType);
   img.font("arial");
   img.fontPointsize(38);
   img.fillColor("white");
   img.boxColor("#00000072");
   img.annotate( "Shot #12345", "+310+50");
   img.composite( logoImg, "+215+120", BumpmapCompositeOp);
   img.write(output);
}


When I'm running it the memory usage is growing up very fast. For example, when I start the program the memory start around 15 000k and after 4000 files converted the memory is around 63 000k. If I let my software running for all the files I have to convert, the software crash.

So I tried to eliminate function calls and when I removed this call:
img.annotate( "Shot #12345", "+310+50");
The memory stay at the same level. I think it has memory leak with the annotate function.

Could you please check it ?

Refert to the post : http://redux.imagemagick.org/discussion ... &sk=t&sd=a


thanks again

Re: Memory leak with Image::annotate in magick++

Posted: 2007-08-23T18:24:01-07:00
by magick
We have a patch for the problem you report in ImageMagick 6.3.5-7 Beta available sometime tomorrow.

Re: Memory leak with Image::annotate in magick++

Posted: 2007-08-24T12:50:22-07:00
by fournij
Thanks

when are you planning to do a Windows Binary Release like ImageMagick-6.3.5-7-Q16-windows-dll.exe ?