I need to validate if the HTTP-request response is an image, I would like to do it using Magick.NET rather than relying on the content-type of the response as I will resize the image and need to be sure that the input is processable by the library.
I saw some posts that suggest reading the image, but I know that there is a specialized command "identify" that will do the trick with lower impact on the performance, unfortunately, I haven't found a way to use it from Magic.NET.
Is there a way to use the identify command from C# or should I read the stream using new MagickImage(inputStream).Format?
I found that the identify command can be used through the MagickImageInfo MagickImageInfo class that under the hood uses the
MagickImage.Ping