I have a problem with MagickReadImageBlob

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
aireys

I have a problem with MagickReadImageBlob

Post 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
aireys

Re: I have a problem with MagickReadImageBlob

Post by aireys »

I just want create a MagicKWand from a buffer
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: I have a problem with MagickReadImageBlob

Post by magick »

Use MagickGetException() to report why MagickReadImageBlob() failed. That will give you insight into why the read failed.
Post Reply