how to get the real error string from MagickReadImage

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
umen
Posts: 12
Joined: 2012-06-27T06:49:24-07:00
Authentication code: 13

how to get the real error string from MagickReadImage

Post by umen »

Hello all
im begginer with this great lib , and i started to work with simple example .
the problem is that im looking to get the real error ( if even i can get it ) other then true or false
for example i have this function :

Code: Select all

if(MagickReadImage(mw,"D:\\cpp\\debug\\image.jpg") == MagickFalse) {
        // Handle the error
		int y =0;
	}
im getting false all the time , even that the image.jpg is there in the path
can i get more info from the functions? to see what is wrong ?
thanks
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: how to get the real error string from MagickReadImage

Post by el_supremo »

Add this piece of code.

Code: Select all

	char error_string[256];
	char *description;
	ExceptionType severity;
	
	description=MagickGetException(mw,&severity);
	FormatLocaleString(error_string,250,"%s %s %lu %s\n",GetMagickModule(),description);
	description=(char *) MagickRelinquishMemory(description);
	// Display the error message
	MessageBox(NULL,error_string,"",MB_OK);
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
umen
Posts: 12
Joined: 2012-06-27T06:49:24-07:00
Authentication code: 13

Re: how to get the real error string from MagickReadImage

Post by umen »

Thanks
I do get error that says something like :

Code: Select all

 NoDecodeDelegateForThisImageFormat `D:\cpp\\debug\image.jpg' @ error/constitute.c/ReadImage/544
which Decode it talking about ?

im using :
Imagemagick/lib/debug\CORE_DB_magick_.lib
Imagemagick/lib/debug\CORE_DB_wand_.lib

and :
CORE_DB_bzlib_.dll
CORE_DB_lcms_.dll
CORE_DB_magick_.dll
CORE_DB_ttf_.dll
CORE_DB_wand_.dll
CORE_DB_xlib_.dll
CORE_DB_zlib_.dll

do i miss something ?
Thanks
umen
Posts: 12
Joined: 2012-06-27T06:49:24-07:00
Authentication code: 13

Re: how to get the real error string from MagickReadImage

Post by umen »

ok i was missing configuration and dll files ,
i didn't find any visual studio tutorial on how to set up simple project ...
gobnait
Posts: 1
Joined: 2012-12-12T04:34:54-07:00
Authentication code: 6789

Re: how to get the real error string from MagickReadImage

Post by gobnait »

I absoltyle vfdfewo Pixels will also be setted manually and individually. And at end of setting all array W x H pixels will be pushed to IMagic by SyncImagePixels.
Post Reply