Page 1 of 1

Catch image's binaries

Posted: 2011-04-25T08:52:11-07:00
by SM75
Hi,

I'm using the MagickWriteImage() method to create my own images. But I want to save them in a DataBase. That's why I'm trying but without success to find a way to catch the string used, i guess by a fwrite(), to create an image (without actually creates it). Is there a method to do this?

Thanks

Re: Catch image's binaries

Posted: 2011-04-25T09:43:54-07:00
by magick
MagickGetImageBlob().

Re: Catch image's binaries

Posted: 2011-05-16T09:03:50-07:00
by SM75
Hi,

Thank you for your quick response (unlike mine).

I'm trying to use this method, here is my approach:

wand = NewMagickWand();
MagickConstitueImage(wand, ...);
MagickSetImageFormat(wand, png) <---- I tried MagickSetFormat().
MagickSetDepth(...) <---- I tried without
MagickGetImageBlob(wand,&lengthBlob);

It only returns the header of my image "%PNG -->"

Replace MagickGetImageBlob() by MagickWriteImage(wand, outputpath) generates the image I expected.

What's the problem?