Some problem about debug into IM

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
MikeDai
Posts: 2
Joined: 2012-02-03T02:23:10-07:00
Authentication code: 8675308

Some problem about debug into IM

Post 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!
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Some problem about debug into IM

Post 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.
MikeDai
Posts: 2
Joined: 2012-02-03T02:23:10-07:00
Authentication code: 8675308

Re: Some problem about debug into IM

Post 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)?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Some problem about debug into IM

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply