Page 1 of 1

unrecognized pixel map error| VS2015 x64 Modified Demo\Button.dsp

Posted: 2016-04-12T23:35:02-07:00
by aw1
Hi,

I could really use some help. I'm receiving an error, "Caught exception: button.exe: unrecognized pixel map `p' @ error/pixel.c/ExportImagePixels/2065", when using the image.write() command. I think it has something to do with the project configuration, presumably arising due to the automatic conversion to Visual Studio 2015.
I'm using the packaged 'button' demo project, and the only modification I've made is replacing "button.write("button_out.miff");" with the following:
char* pixels;
char s[] = { 'p' };
button.write(0, 0, 1, 1, s, MagickCore::StorageType::UndefinedPixel, &pixels);

I believe the error stems from converting the demo project to VS2015, as the exception isn't caught on ubuntu. The only changes I've made beyond the automatic conversion are changing the solution platform from x86 to x64, and copying across the settings from x86 (else it wouldn't build). I found this slightly weird as its from the 64bit build of ImageMagick, but maybe I'm missing something. The only other change I've made is setting the linker output to the x64\Release directory. Is there anything I'm missing? Any suggested changes to the project configuration? Thanks in advance for any help.

Re: unrecognized pixel map error| VS2015 x64 Modified Demo\Button.dsp

Posted: 2016-04-12T23:43:20-07:00
by aw1
Additionally, using "ImageMagick-6.9.3-8-Q16-x64-dll.exe", though happens with other versions as well.

Re: unrecognized pixel map error| VS2015 x64 Modified Demo\Button.dsp

Posted: 2016-04-13T04:52:31-07:00
by snibgo
aw1 wrote:char s[] = { 'p' };
From the source code, it seems to require upper-case.

Re: unrecognized pixel map error| VS2015 x64 Modified Demo\Button.dsp

Posted: 2016-04-13T22:24:46-07:00
by aw1
Thanks for replying, but that doesn't appear to be it. I've tried upper and lower case and different letters. Also can you link me to the source code, I've been looking at "http://git.imagemagick.org/repos/ImageM ... re/pixel.c", which seems to take both upper and lower case.
Thanks again.

Re: unrecognized pixel map error| VS2015 x64 Modified Demo\Button.dsp

Posted: 2016-04-14T06:27:52-07:00
by snibgo
Sorry, I was looking at the wrong part of pixel.c. Yes, lower-case should be fine.

Code: Select all

char s[] = { 'p' };
If this C++? I hope it creates an array of two characters, setting the first to 'p' and the second to '\0'.

I don't know what to suggest.

Re: unrecognized pixel map error| VS2015 x64 Modified Demo\Button.dsp

Posted: 2016-04-15T02:47:25-07:00
by aw1
I think I've worked it out, the issue was with using "MagickCore::StorageType::UndefinedPixel", not with the map. Line 2065 in the Windows source lines up with line 2129 on the previous git link. There's no export method for the storage type, and to be honest I'm not sure why I was testing with it. I have a strong suspicion it should give a different error message / throw a different exception, maybe something about StorageType instead of PixelMap. Can anyone confirm this before I attempt a bug report?
Thanks snibgo for the time and effort.

Re: unrecognized pixel map error| VS2015 x64 Modified Demo\Button.dsp

Posted: 2016-04-15T03:10:12-07:00
by aw1
Turns out UndefinedPixel matches up with the example on https://www.imagemagick.org/Magick++/Image++.html [image.write(0,0,640,1,"RGB",0,pixels);]