Page 1 of 1

Problem with gflBitmapSetIPTC and GFL 2.40

Posted: Thu Jul 07, 2005 4:47 pm
by Ithier
Hi,

I have tested the gflBitmapSetIPTC function and have a problem. When I save the image after I have added some iptc data and saved them in the GFL_BITMAP structure with the gflBitmapSetIPTC then the application crash when I call gflSaveBitmap. I have tested it with VC++ and dev-cpp (g++) and have the same problem. But it is very strange because when I use my debugger with dev-cpp, then it doesn't crash anymore !!

Here is the code to reproduce the problem:

Code: Select all

#include "libgfl.h"

int main(int argc, char *argv[])
{
	gflLibraryInit();

	GFL_LOAD_PARAMS load_option;
	gflGetDefaultLoadParams( &load_option );
    GFL_FILE_INFORMATION    GflFI;
    GFL_BITMAP*     GflBitmap;
	gflLoadBitmap(argv[1], &GflBitmap, &load_option, &GflFI);

    //Add iptc Data
    GFL_IPTC_DATA* iptc = gflNewIPTC();
    gflSetIPTCValue(iptc, GFL_IPTC_BYLINE, "moi");
    gflBitmapSetIPTC(GflBitmap, iptc);

   	GFL_SAVE_PARAMS save_option;
    gflGetDefaultSaveParams(&save_option);
    save_option.FormatIndex = gflGetFormatIndexByName("jpeg");
    printf ("before save\n");
    gflSaveBitmap("o.jpg", GflBitmap, &save_option);
	return 0;
}

I have tested with several images and have always the same behaviour.
I hope you can help me with this problem.

Ithier

Re: Problem with gflBitmapSetIPTC and GFL 2.40

Posted: Sat Jul 09, 2005 12:32 pm
by xnview
Ithier wrote:Hi,

I have tested the gflBitmapSetIPTC function and have a problem. When I save the image after I have added some iptc data and saved them in the GFL_BITMAP structure with the gflBitmapSetIPTC then the application crash when I call gflSaveBitmap. I have tested it with VC++ and dev-cpp (g++) and have the same problem. But it is very strange because when I use my debugger with dev-cpp, then it doesn't crash anymore !!

Here is the code to reproduce the problem:

Code: Select all

#include "libgfl.h"

int main(int argc, char *argv[])
{
	gflLibraryInit();

	GFL_LOAD_PARAMS load_option;
	gflGetDefaultLoadParams( &load_option );
    GFL_FILE_INFORMATION    GflFI;
    GFL_BITMAP*     GflBitmap;
	gflLoadBitmap(argv[1], &GflBitmap, &load_option, &GflFI);

    //Add iptc Data
    GFL_IPTC_DATA* iptc = gflNewIPTC();
    gflSetIPTCValue(iptc, GFL_IPTC_BYLINE, "moi");
    gflBitmapSetIPTC(GflBitmap, iptc);

   	GFL_SAVE_PARAMS save_option;
    gflGetDefaultSaveParams(&save_option);
    save_option.FormatIndex = gflGetFormatIndexByName("jpeg");
    printf ("before save\n");
    gflSaveBitmap("o.jpg", GflBitmap, &save_option);
	return 0;
}

I have tested with several images and have always the same behaviour.
I hope you can help me with this problem.

Ithier
Yes, strange. I have no problem. Perhaps you could send me a picture to check?