Page 1 of 1

Some problem about debug into IM

Posted: 2012-02-06T00:30:14-07:00
by MikeDai
hello
I'm a newer, and want to ask some simple problem.
When I debug in the code, such as file magick/constitute.c, line 579, (image=(Image *) (GetImageDecoder(magick_info))(read_info,exception);), this line read the pixel into the variable(image), but I can't step into it, and don't know how does it do that and I even don't know where to watch each pixel data.
Then when I do some work to my image, also I can't find the exact code to process the pixel of the image.
I don't know whether this part is not opensourse or I didn't get the right method? Can you tell me how to solve it?
Thanks!

Re: Some problem about debug into IM

Posted: 2012-02-06T05:11:41-07:00
by magick
GetImageDecoder() returns the decoder for a particular image format. If your image is JPEG, for example, it calls the ReadJPEGImage() method located in coders/jpeg.c.

Re: Some problem about debug into IM

Posted: 2012-02-07T22:32:16-07:00
by MikeDai
magick wrote:GetImageDecoder() returns the decoder for a particular image format. If your image is JPEG, for example, it calls the ReadJPEGImage() method located in coders/jpeg.c.
Thank you!
But I also want to know how can I step into ReadJPEGImage(), and when I debug IM, where can I watch the exact pixels of my image (in which variable)?

Re: Some problem about debug into IM

Posted: 2012-02-07T23:24:59-07:00
by anthony
ReadJPEGImage() will be calling a external library.

Also debugging a coder is more difficult as it is a 'module'. That is the function is not loaded until it is actually required for the first time. IM does this so that if a user does not need a JPEG image IM does not have a hard-coded dependency on the external JPEG library.

It should be posible to debug a runtime loaded module, but I have never done so, so I am not certain how it is done.