LongPixel not working in image.read

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
rohitlal
Posts: 6
Joined: 2019-01-08T07:33:51-07:00
Authentication code: 1152

LongPixel not working in image.read

Post by rohitlal » 2019-01-08T07:52:51-07:00

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 ?

snibgo
Posts: 11908
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: LongPixel not working in image.read

Post by snibgo » 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?
snibgo's IM pages: im.snibgo.com

rohitlal
Posts: 6
Joined: 2019-01-08T07:33:51-07:00
Authentication code: 1152

Re: LongPixel not working in image.read

Post by rohitlal » 2019-01-08T21:10:39-07:00

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

snibgo
Posts: 11908
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: LongPixel not working in image.read

Post by snibgo » 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.
snibgo's IM pages: im.snibgo.com

rohitlal
Posts: 6
Joined: 2019-01-08T07:33:51-07:00
Authentication code: 1152

Re: LongPixel not working in image.read

Post by rohitlal » 2019-01-09T04:22:09-07:00

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++.

snibgo
Posts: 11908
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: LongPixel not working in image.read

Post by snibgo » 2019-01-09T04:35:38-07:00

Perhaps the problem is not an exception within IM, but a bug in your code, such as writing to an array out of bounds.
snibgo's IM pages: im.snibgo.com

Post Reply