Hi,

I'd like to suggest a few ideas. These are not related to your issue's solution, but they might be tips you have overlooked (or not).

You can achieve the same number-indexed png filenames with pngwriter_rename(), just cast the iteration variable i to an unsigned long int, and use it as the argument for pngwriter_rename(). The .png extension will be added automatically.

You don't need to readfromfile() inside the loop, though perhaps you were planning on reading from different files later on?

Unless you specifically need the UTF-8 plot_text function, you might want to use the plain one. No specific reason for this hint, really.

close() and write_png() are in fact identical. Just different names for mnemonic reasons.


I hope these tips are useful.


Paul


On 15 Sep 2004, at 14:58, <[EMAIL PROTECTED]> wrote:

This program crashes my machine (winxp with MSVC++ 7.10) when using
burro.png. I notice the memory build up and up and then it dies. I has only
happened since I began experimenting with readfromfile. Have I done
something wrong or is there a problem here?

// xbnbt_test_png.cpp
//

#include <pngwriter.h>

void test ()
{
        pngwriter image( 1, 1, 0.0, "out.png" );
        image.setcompressionlevel( 0 );
        char cName[255];
        
        for( int i = 0; i != 1000; i++ )
        {
                sprintf( cName, "%d.png", i );

                std::cout << "Writing: " << cName;

                image.pngwriter_rename( cName );

                image.readfromfile( "burro.png" );

                image.plot_text_utf8( "arial.ttf", 14 ,4 ,4, 0.0, cName,
0.0, 0.0, 0.0 );

                image.write_png();
                        
                std::cout << "        Done.\n";
        }
        image.close( );
}
                        
int main()
{
        test();

        system("PAUSE");
}

For some reason it crashes at image 508.

Permissions are fine.

Not sure how to send a backtrace but I will find out.




------------------------------------------------------- This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM. Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php _______________________________________________ http://pngwriter.sourceforge.net/ PNGwriter-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/pngwriter-users

Reply via email to