title: how can I get image size (w x h) using Stream
body: <p>I have this code i am using to read uploaded file, but i need to get size of image instead but not sure what code can i use</p>
  
  <pre><code>HttpFileCollection collection = _context.Request.Files;
              for (int i = 0; i &lt; collection.Count; i++)
              {
                  HttpPostedFile postedFile = collection[i];
  
                  Stream fileStream = postedFile.InputStream;
                  fileStream.Position = 0;
                  byte[] fileContents = new byte[postedFile.ContentLength];
                  fileStream.Read(fileContents, 0, postedFile.ContentLength);
  </code></pre>
  
  <p>I can get the file right but how to check it's image  (width and size) sir ?</p>