I recently upgraded most of my programs to use GflSDK2.20.
One of my Applications (SimilarImages - that dupe checker), now crashes whenever it comes to the dataset generation routines.
I just recompiled and linked against Version 2.20... After switching back to 2.11 it everything works well again.
I traced the call stack and it seems gflSoften "started" an Access Violation that then will be raised in later gflFunction calls.
Although it is no problem to call gflSaveBitmap right after gflSoften.
My code is (Borland C++Builder6 fully patched, C++, Win32 (XP Pro SP1 Box)):
Code: Select all
void __fastcall ApplyFilters(GFL_BITMAP **BMP)
{
gflEqualizeOnLuminance(*BMP, NULL);
/* "Working" (means, not complaining about failures) but introducing the crash */
gflSoften(*BMP, NULL, 33);
/* Crash */
gflNormalize(*BMP, NULL);
gflAutoCrop(*BMP, NULL, NULL, 85);
}
Didnt work too.
(running it for debugging in apps main thread)
Another testcase performed by a MSVC 6 (SPs + ProcessorPack) build...
Simplied version of what I do in my application until it crashes.
Code: Select all
// gflsoftentest.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "libgfl.h"
#include "libgfle.h"
void ApplyFilters(GFL_BITMAP **BMP)
{
gflEqualizeOnLuminance(*BMP, NULL);
gflSoften(*BMP, NULL, 33);
gflNormalize(*BMP, NULL); // crashes
gflAutoCrop(*BMP, NULL, NULL, 85); // crashes (when gflNormalize is commented out)
}
int main(int argc, char* argv[])
{
gflLibraryInit();
gflEnableLZW(GFL_TRUE);
GFL_BITMAP *BMP;
GFL_FILE_INFORMATION fileinfo;
GFL_LOAD_PARAMS params;
GFL_SAVE_PARAMS sparams;
gflGetDefaultThumbnailParams(¶ms);
params.Flags |=
GFL_LOAD_HIGH_QUALITY_THUMBNAIL
| GFL_LOAD_SKIP_ALPHA
| GFL_LOAD_PREVIEW_NO_CANVAS_RESIZE
| GFL_LOAD_FORCE_COLOR_MODEL
;
params.ColorModel = GFL_RGB;
gflGetDefaultSaveParams(&sparams);
sparams.FormatIndex = gflGetFormatIndexByName("jpeg");
gflLoadThumbnail(
"test.jpg",
420,
420,
&BMP,
¶ms,
&fileinfo
);
gflSaveBitmap(
"th1.jpg",
BMP,
&sparams
);
ApplyFilters(&BMP);
gflSaveBitmap(
"th2.jpg",
BMP,
&sparams
);
gflFreeBitmap(BMP);
gflFreeFileInformation(&fileinfo);
gflLibraryExit();
return 0;
}
(But works without gflSoften call)
Cheers
Nils