Page 1 of 1

I have a problem with MagickReadImageBlob

Posted: 2008-01-07T23:19:17-07:00
by aireys
I work with C API.
My code:

FILE *f = fopen("bomb.jpg", "rb");
size_t fsize = getfilesize(f);
void *content = malloc(fsize);
read(content, 1, fsize, f);

//I'm sure above is ok

MagicKWand *wand = NewMagickWand();
MagickSetFormat(wand, "jpg");
MagickSetFilename(wand, "jpg:out.jpg");
status = MagickReadImageBlob(wand, content, fsize);

status is MagickFalse
why ?please help me. My email: aireys@126.com

Re: I have a problem with MagickReadImageBlob

Posted: 2008-01-07T23:37:51-07:00
by aireys
I just want create a MagicKWand from a buffer

Re: I have a problem with MagickReadImageBlob

Posted: 2008-01-08T08:47:06-07:00
by magick
Use MagickGetException() to report why MagickReadImageBlob() failed. That will give you insight into why the read failed.