get dimensions of an image on the web - avoid memory hog?
<p>Im getting some images from a webpage at a specified url, i want to get their heights and widths. I'm using something like this:</p>

<pre><code> Stream str = null;
 HttpWebRequest wReq = (HttpWebRequest)WebRequest.Create(ImageUrl);
 HttpWebResponse wRes = (HttpWebResponse)(wReq).GetResponse();
 str = wRes.GetResponseStream();

 var imageOrig = System.Drawing.Image.FromStream(str);
 int height = imageOrig.Height;
 int width = imageOrig.Width;
</code></pre>

<p>My main concern with this is that that the image file may actually be very large,</p>

<p>Is there anything I can do? ie specify to only get images if they are less than 1mb?
or is there a better alternative approach to getting the dimension of an image from a webpage?</p>

<p>thanks</p>
