Page 1 of 1

Posted: 2006-03-28T13:09:14-07:00
by magick
You have a few mistakes in your code. When you call MagickGetImageBlob() you need to specify an image format and depth so instead of
  • unsigned char * data = MagickGetImageBlob(magick_wand,&length);
you want

Code: Select all

MagickSetImageDepth(magick_wand,8);
MagickSetImageFormat(magick_wand,"RGB");
data = MagickGetImageBlob(magick_wand,&length);
However, a more efficient way is to call MagickGetImagePixels() which always returns raw image pixels.

To correct for the upside down image, simply call MagickFlipImage().