Page 1 of 1

LongPixel not working in image.read

Posted: 2019-01-08T07:52:51-07:00
by rohitlal
I'm reading image from the pixel data :

Code: Select all

    image.read(4096,4096, "R", CharPixel, pixelDataPointer);
    image.write("my_image.bmp");
and it works fine.

But, when I use "LongPixel", the program doesn't runs well & throws error.

Code: Select all

    image.read(4096,4096, "R", LongPixel, pixelDataPointer);
    image.write("my_image.bmp");
Does it means that my input pixel data array can only be interpreted as character bits ?

Re: LongPixel not working in image.read

Posted: 2019-01-08T08:27:16-07:00
by snibgo
rohitlal wrote:... the program doesn't runs well & throws error.
What goes wrong? What is the error message?

Re: LongPixel not working in image.read

Posted: 2019-01-08T21:10:39-07:00
by rohitlal
snibgo wrote: 2019-01-08T08:27:16-07:00
rohitlal wrote:... the program doesn't runs well & throws error.
What goes wrong? What is the error message?
Error Message : Unhandled exception at 0x00007FFAEF063A7B (CORE_RL_MagickCore_.dll) in GrablinkSnapshot.exe: 0xC0000005: Access violation reading location 0x000001DB381B0000.

Please tell me where I'm going wrong

Re: LongPixel not working in image.read

Posted: 2019-01-09T02:32:38-07:00
by snibgo
rohitlal wrote:Unhandled exception
I suggest you include an error handler, and print the exception error message it gives.

Re: LongPixel not working in image.read

Posted: 2019-01-09T04:22:09-07:00
by rohitlal
snibgo wrote: 2019-01-09T02:32:38-07:00
rohitlal wrote:Unhandled exception
I suggest you include an error handler, and print the exception error message it gives.
I tried to put the whole code in try catch statements but still not able to catch that exception.
Sorry for novice questions, but i'm new to c++.

Re: LongPixel not working in image.read

Posted: 2019-01-09T04:35:38-07:00
by snibgo
Perhaps the problem is not an exception within IM, but a bug in your code, such as writing to an array out of bounds.