Page 1 of 1

Problems with GetConfigureInfo, ListConfigureInfo etc.

Posted: 2006-02-23T17:53:58-07:00
by el_supremo
I'm using 6.2.6 on Win XP Pro system.
The GetConfigureInfo function doesn't seem to be returning the correct info.
The configure.xml file contains eight configure entries but the GetConfigureInfo function says that there are 16 and when I list them, it has each of those eight entries duplicated.
This code (with appropriate declarations and Initialize and Destroy Magick around it):

Code: Select all

		p = GetConfigureList("*",&no,&exception);
		f = fopen("configlist.txt","w");
		fprintf(f,"%ld\n",no);
		while(*p != NULL) {
			fprintf(f,"%s\n",*p++);
		}
		fclose(f);
produces this in configlist.txt:
16
COPYRIGHT
COPYRIGHT
HOST
HOST
LIB_VERSION
LIB_VERSION
LIB_VERSION_NUMBER
LIB_VERSION_NUMBER
NAME
NAME
RELEASE_DATE
RELEASE_DATE
VERSION
VERSION
WEBSITE
WEBSITE

If I use that same code but call GetCoderList instead, it generates the correct info.
While trying to sort out why this was happening I decided to try ListConfigureInfo:

Code: Select all

		file = fopen("coderopts.txt","w");
		if(file != NULL) {
			ListConfigureInfo(file,&exception);
			fclose(file);
		}
This crashes and later on I found that ListCoderInfo also crashes - both trying to write to address 00000010 in strcmpi.
GetTypeList works but ListTypeInfo crashes.

I haven't been able to find the problem yet.

Pete

Posted: 2006-02-23T19:35:06-07:00
by magick
We assume you declared *p as char **p? We tried your code under Windows XP with ImageMagick 6.2.6-1 and the GetConfigureList() method properly returned the configure list as expected without complaint or fault.

Posted: 2006-02-23T20:31:22-07:00
by el_supremo
We assume you declared *p as char **p?

Yes.

Posted: 2006-02-25T08:58:41-07:00
by el_supremo
I installed 6.2.6-1 from the windows binary and tried it again (I was previously using my own compiled version).
GetConfigureList now correctly returns 8 items but ListTypeInfo, ListCoderInfo and ListConfigureInfo all crash when used as shown in the second code snippet in my original message. I vaguely remembered that I've had problems with this type of thing before so I also tried IdentifyImage as shown below and it also crashes in the same way.

Code: Select all

FILE *file;
ExceptionInfo exception;
MagickPixelPacket pixel;
Image *image;
ImageInfo *imageInfo;

InitializeMagick(NULL);
GetExceptionInfo(&exception);
imageInfo = CloneImageInfo(NULL);
QueryMagickColor("red", &pixel, &exception);
image = NewMagickImage(imageInfo, 400, 400, &pixel);
SetImageOpacity(image, (Quantum)(MaxRGB*0.5));
strcpy(image->filename, "test1.png");
WriteImage(imageInfo, image);

file = fopen("identify.txt","wt");
if(file != NULL) {
	IdentifyImage(image,file,MagickFalse);
	fclose(file);
}
DestroyImage(image);

The file is created but empty.
Maybe there's something amiss with my program or my system but I can't figure out what's going wrong.

Pete

Posted: 2006-02-25T09:47:41-07:00
by magick
We tried your code with ImageMagick 6.2.6-1 under Windows compiled with Visual C++ 2003 .Net and it worked without complaint. It produced a file with the image attributes in it as expected.

Posted: 2006-02-25T18:33:18-07:00
by el_supremo
That's the compiler I'm using now.
Is there some way you could post or email me the code, .sln file etc. for me to try?

Pete

Posted: 2006-02-25T20:56:47-07:00
by magick
To test your code we just cut-n-pasted your code snippet into the button project you find in c:\Program Files\ImageMagick-6.2.6-Q16\Magick++_Demos. When you get an undefined symbol just add MagickLib:: in front of it to tell the C++ compiler to look in the MagickLib namespace.