Page 1 of 1

compilation error

Posted: 2007-08-28T02:22:23-07:00
by udayk82
Hi Friends,
I am facing a problem in compiling and executing a c program which uses ImageMagick.h header file. It compiled without any error, but while executing the code i get the following error message..

Code: Select all

example1: coders/jpeg.c:679: ReadJPEGImage: Assertion `exception->signature == 0xabacadabUL' failed.
Aborted
To give complete information, the program is written just to check the utility of ImageMagick..

Code: Select all


Image *image;

      ImageInfo image_info;

      ExceptionInfo *exception;

      /*
        Initialize the image info structure and read an image.
      */
      GetImageInfo(&image_info);
      (void) strcpy(image_info.filename,"image.jpg");
      image=ReadImage(&image_info,exception);
      if (image == (Image *) NULL)
        exit(1);
Did anybody face this problem before??

Re: compilation error

Posted: 2007-08-30T18:40:05-07:00
by anthony
It means the structure you gave to the IM library was NOT the structure it was expecting.

Re: compilation error

Posted: 2007-08-30T19:11:17-07:00
by el_supremo
"exception" is an uninitialized pointer.
You can declare, initialize and use it like this:

Code: Select all

ExceptionInfo exception;

GetExceptionInfo(&exception);
image=ReadImage(&image_info,&exception);
Pete

Re: compilation error

Posted: 2007-08-30T20:16:44-07:00
by magick
The newer preferred way to handle exceptions:
ExceptionInfo *exception;
exception=AcquireExceptionInfo();
image=ReadImage(ImageInfo,exception);
...
exception=DestroyExceptionInfo(exception);

Re: compilation error

Posted: 2007-08-30T21:04:41-07:00
by anthony
That better be put in the architecture document.

Along with any changes to the whey a function should handle colors, and specifically
the CMYK black channel and alpha channel.