I want to test file input by uploading image with cypress-file-upload but asp.net Bitmap class
throw exception error Parameter is not valid when it gets the image by InputStream
Asp.net class that handling image compressing process
Public Sub SaveAs(ImagePath As String, ImageWidth As Integer, ImageHeight As Integer)
Try
Dim originalBitmap As Bitmap = New Bitmap(OriginalImage.InputStream)
Dim originalWidth As Integer = originalBitmap.Width
Dim originalHeight As Integer = originalBitmap.Height
Dim bitMAP1 = New Bitmap(originalBitmap, originalWidth, originalHeight)
Dim graph = Graphics.FromImage(bitMAP1)
graph.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality
graph.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality
graph.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
Dim imageRectangle = New Rectangle(0, 0, ImageWidth, ImageHeight)
graph.DrawImage(originalBitmap, imageRectangle)
bitMAP1.SetResolution(300, 300)
bitMAP1.Save(ImagePath, System.Drawing.Imaging.ImageFormat.Jpeg)
graph.Dispose()
bitMAP1.Dispose()
Catch __unusedException1__ As Exception
Throw
End Try
End Sub
I want to test file input by uploading image with
cypress-file-upload
but asp.netBitmap
class throw exception errorParameter is not valid
when it gets the image byInputStream
Cypress spec command
Asp.net class that handling image compressing process