Change ReadImage() to PingImage()

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
diuming
Posts: 22
Joined: 2011-01-16T22:07:22-07:00
Authentication code: 8675308

Change ReadImage() to PingImage()

Post by diuming »

Dear master,

I refer to http://www.imagemagick.org/script/magick-core.php's core.c and compile and run it , It working very well in my computer.
But When I change ReadImage() to PingImage() function and recompile and then run it, It's always appear "Segmentation fault".

I think the PingImage() load source image is faster then ReadImage(), But I get Image always 0x00, Why?

Image * image = PingImage(...,....);
^------- 0x00 (NULL)

Could somebody point out my mistake.

thanks :D
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Change ReadImage() to PingImage()

Post by el_supremo »

PingImage does not load the image. It is used as a fast way to obtain information about the image, such as its width and height, without having to also load the image.

Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
diuming
Posts: 22
Joined: 2011-01-16T22:07:22-07:00
Authentication code: 8675308

Re: Change ReadImage() to PingImage()

Post by diuming »

Does MagickCore has any function to load image faster than ReadImage()? (Maybe block by block, not scanline)

Thanks
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Change ReadImage() to PingImage()

Post by magick »

Does MagickCore has any function to load image faster than ReadImage()? (Maybe block by block, not scanline)
If you know the format of the image, you can call the decoder directly rather than ReadImage(). Use GetImageDecoder() with the handle from GetMagickInfo(). However, we suspect the speed-up would not be significant.
diuming
Posts: 22
Joined: 2011-01-16T22:07:22-07:00
Authentication code: 8675308

Re: Change ReadImage() to PingImage()

Post by diuming »

Thanks!

If I focus on hardware, Which one to replace can be speedup!!
Post Reply