アップロードされたファイルを読み取るために使用しているこのコードがありますが、代わりに画像のサイズを取得する必要がありますが、どのコードを使用できるかわかりません
HttpFileCollection collection = _context.Request.Files;
for (int i = 0; i < 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);
ファイルを正しく取得できますが、画像 (幅とサイズ) を確認するにはどうすればよいですか?