Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
udayk82
Post
by udayk82 » 2007-08-28T02:22:23-07:00
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??
anthony
Posts: 8883 Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia
Post
by anthony » 2007-08-30T18:40:05-07:00
It means the structure you gave to the IM library was NOT the structure it was expecting.
el_supremo
Posts: 1015 Joined: 2005-03-21T21:16:57-07:00
Post
by el_supremo » 2007-08-30T19:11:17-07:00
"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
magick
Site Admin
Posts: 11064 Joined: 2003-05-31T11:32:55-07:00
Post
by magick » 2007-08-30T20:16:44-07:00
The newer preferred way to handle exceptions:
ExceptionInfo *exception;
exception=AcquireExceptionInfo();
image=ReadImage(ImageInfo,exception);
...
exception=DestroyExceptionInfo(exception);
anthony
Posts: 8883 Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia
Post
by anthony » 2007-08-30T21:04:41-07:00
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.