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

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
aw1
Posts: 5
Joined: 2016-04-12T03:26:51-07:00
Authentication code: 1151

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

Post 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.
aw1
Posts: 5
Joined: 2016-04-12T03:26:51-07:00
Authentication code: 1151

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

Post by aw1 »

Additionally, using "ImageMagick-6.9.3-8-Q16-x64-dll.exe", though happens with other versions as well.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post by snibgo »

aw1 wrote:char s[] = { 'p' };
From the source code, it seems to require upper-case.
snibgo's IM pages: im.snibgo.com
aw1
Posts: 5
Joined: 2016-04-12T03:26:51-07:00
Authentication code: 1151

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

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
aw1
Posts: 5
Joined: 2016-04-12T03:26:51-07:00
Authentication code: 1151

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

Post 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.
aw1
Posts: 5
Joined: 2016-04-12T03:26:51-07:00
Authentication code: 1151

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

Post 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);]
Post Reply