Catch image's binaries

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
SM75
Posts: 2
Joined: 2011-04-25T08:34:55-07:00
Authentication code: 8675308

Catch image's binaries

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Catch image's binaries

Post by magick »

MagickGetImageBlob().
SM75
Posts: 2
Joined: 2011-04-25T08:34:55-07:00
Authentication code: 8675308

Re: Catch image's binaries

Post 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?
Post Reply