I want to check size image from url in C#.
Ex: Url: http://img.khoahoc.tv/photos/image/2015/05/14/hang_13.jpg
Hover over the URL to see the pop up with all of the image properties. This pop up includes the Rendered size – the dimensions that the website needs – as well as the Intrinsic size – the dimensions of the originally image uploaded.
You can easily find the original or intrinsic width and heigh of an image using the HTML5 image naturalWidth and naturalHeight properties. These properties are supported in all major web browsers such as Chrome, Firefox, Safari, Opera, Internet Explorer 9 and above.
Download and check:
string image = @"http://img.khoahoc.tv/photos/image/2015/05/14/hang_13.jpg";
byte[] imageData = new WebClient().DownloadData(image);
MemoryStream imgStream = new MemoryStream(imageData);
Image img = Image.FromStream(imgStream);
int wSize = img.Width;
int hSize = img.Height;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With