private static string GetImageType(Stream inStream)
{
try
{
var bytes = new byte[2];
inStream.Position = 0;
inStream.Read(bytes, 0, 2);
inStream.Position = 0;
var imgType = Encoding.UTF8.GetString(bytes, 0, 2);
return imgType;
}
catch
{
return null;
}
}