Function validateDimension() As Boolean
Dim imageBytes(imageupload.PostedFile.InputStream.Length) As Byte
Dim stream As System.IO.Stream = imageupload.PostedFile.InputStream
stream.InitializeLifetimeService()
stream.Read(imageBytes, 0, imageBytes.Length)
Dim imagedata As System.Drawing.Image = System.Drawing.Image.FromStream(stream)
Dim imageWidth As Integer = imagedata.PhysicalDimension.Width 'PhysicalDimension.Height
Dim imageHeight As Integer = imagedata.PhysicalDimension.Height
If imageWidth >= 200 And imageHeight >= 200 Then
Return True
Else
Return False
End If
End Function
why would you return true if you catch an exception?
ReplyDeleteThanx 4 pointing out the prob.. :)
ReplyDelete