How can I determine if a file is an image file in .NET?
If you will only be supporting a handful of the popular image formats, then you can simply read the first few bytes of the file to determine the type based on the Magic Number Examples from the link provided: GIF image files have the ASCII code for “GIF89a” (47 49 46 38 39 61) or … Read more