title: ASP.NET: get height and width of an image
body: <p>Various flavours of this question have been asked but I haven't found a correct answer yet.</p>
  
  <p>Say i have an .jpg image on the file server and that I need to get its height and width. How do I do it in asp.net?</p>
  
  <p>I've seen a few answers which suggests to do something like this:  </p>
  
  <pre><code>System.Drawing.Image image=System.Drawing.Image.FromFile(PicturePath); 
  int ActualWidth=image.Width;
  int ActualHeight=image.Height;
  image.Dispose();
  </code></pre>
  
  <p>This would work fine except that <a href="http://msdn.microsoft.com/en-us/library/system.drawing.aspx" rel="noreferrer">classes within the System.Drawing namespace are not supported for use within an ASP.NET service</a>.</p>
  
  <p>So, how do you get the actual height and width of an image in ASP.net?</p>