Page 1 of 1

Change ReadImage() to PingImage()

Posted: 2011-01-18T07:18:20-07:00
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

Re: Change ReadImage() to PingImage()

Posted: 2011-01-18T08:39:18-07:00
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

Re: Change ReadImage() to PingImage()

Posted: 2011-01-18T18:00:20-07:00
by diuming
Does MagickCore has any function to load image faster than ReadImage()? (Maybe block by block, not scanline)

Thanks

Re: Change ReadImage() to PingImage()

Posted: 2011-01-18T19:05:41-07:00
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.

Re: Change ReadImage() to PingImage()

Posted: 2011-01-19T00:32:34-07:00
by diuming
Thanks!

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