Monday, June 28, 2010

How to find the image format of an image in C#

from stackoverflow -
http://stackoverflow.com/questions/1397512/find-image-format-using-bitmap-object-in-c
using(Image img = Image.FromFile(@"C:\path\to\img.jpg"))
{
if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Jpeg))
{
// ...
}
}

No comments: