using System.Drawing;
string imageUrl
using (var client = new WebClient())
{
var dataResult = client.OpenRead(imageUrl);
Image pic = Image.FromStream(dataResult);
long jpegByteSize = 0;
try
{
using (var ms = new MemoryStream())
{
pic.Save(ms, ImageFormat.Jpeg);
jpegByteSize = ms.Length;
}
}
catch (Exception ex)
{
jpegByteSize = -1;
}
var width = pic.Width;
var height = pic.Height;
return new Tuple(width, height, jpegByteSize);
}