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 hope you can help me with this problem.
Ithier