Page 1 of 1

detect format type

Posted: 2009-02-16T07:53:05-07:00
by wchang615
Dear All,

Sorry to bother this list for a simple question:
are there any MagickCore functions to detect what graphic format
(.gif, .jpg, etc.) for a given file?

Thanks.

--Wo

Re: detect format type

Posted: 2009-02-16T08:05:26-07:00
by wchang615
I think I found the answer myself: just just image->magic.

--Wo

Re: detect format type

Posted: 2009-02-16T08:58:47-07:00
by magick
If you just want to detect the format, use PingImage() instead of ReadImage(). PingImage() is lightweight.

Re: detect format type

Posted: 2009-02-16T20:07:42-07:00
by anthony
The 'magick' part is also available (completely outside of IM) using the "file" command. IM itself does similar things in determining image format styles.