Page 1 of 1

Unrecognized pixel map

Posted: 2009-08-28T01:24:54-07:00
by magick_user
Hi all, this is my first post in this forum, and i am a newbe of image magick.
I'm using magick++ in order to get image data from a buffer in memory, but i get an exception "Unrecognized pixel map".
Fllow my code:

Code: Select all

unsigned long imageSize;
char* imageData=NULL;
unsigned long width, height;
int bitCount;

bitCount = 24;
width = 100
height = 100;
imageSize = (((width*bitCount) + 31)/32*4)*height;

imageData = new char[imageSize];

//a blank image
memset(imageData,255,sizeof(char));

std::string map("RGB");
Magick::Image image(width,height,map,MagickCore::IntegerPixel ,(void *)imageData); <-- execption throws here


In the ctor of Image class i got the exception explaied before;
Anyone can help me?
Best regards

Re: Unrecognized pixel map

Posted: 2009-08-28T03:56:23-07:00
by magick_user
Can anyone help me?

Re: Unrecognized pixel map

Posted: 2009-08-28T06:04:14-07:00
by magick
Try
  • map.c_str()
The MagickCore methods require C strings, not C++ strings.

Re: Unrecognized pixel map

Posted: 2009-08-28T06:23:15-07:00
by magick_user
Same result. Nothing to do.
It is strange, but the message is:

"ImageMagick-6.5.5-Q16: Unrecognozed pixel map ΄ÌÌÌÌRGB' @pixel.c/Import imagePixels/1815"

Appear that for some reason, it prepend some extra character.

Re: Unrecognized pixel map

Posted: 2009-08-28T07:30:58-07:00
by magick
We're using ImageMagick 6.5.5-4, the current release, and your code does not produce an exception for us. We're not sure why its failing for you.

Re: Unrecognized pixel map

Posted: 2009-08-31T07:01:31-07:00
by magick_user
That's all?
Anyone can help me?
Any idea?

Re: Unrecognized pixel map

Posted: 2009-08-31T07:47:27-07:00
by magick
We have proven your code works which means the problem is not within ImageMagick but a problem with your compiler, linker, or project settings. If you are working under Windows, transfer your code to the Button project located in c:\Program Files\ImageMagick-6.5.5-4\Magick++_Demos. It has the proper settings to ensure your code will compile and run properly.

Re: Unrecognized pixel map

Posted: 2009-08-31T13:16:53-07:00
by magick_user
Solved.
Tanks.
Best regards