I think the following code "should" work, the output is about the right size for a jpg, but it is not coming out as a valid jpg image file. I have tried saving to disk as well. Please either tell me how to fix this code, or give me a good sample that does not use third-party objects. I am working in .NET 2.0. I have verified permissions are NOT a problem. C# code solutions are fine as well. ---page editor please do not move this to VB.NET.
Dim originalimage As System.Drawing.Image = System.Drawing.Image.FromFile("C:\Test.tif")
Dim stm As New System.IO.MemoryStream
Call originalimage.Save(stm, System.Drawing.Imaging.ImageFormat.Jpeg)
Dim bytes(stm.Length) As Byte
Call stm.Read(bytes, 0, stm.Length - 1)
Response.ContentType = "image/jpeg"
originalimage = Nothing