I do have my project set to 64 bit only. The file coming from the DB could either be a jpeg or bmp. Only happens on large files. Small files work fine. So I'm figuring it is a memory issue. Just don't know how to fix.
byte[] tImg = dr.Field<byte[]>("IMAGE");
Image imgO = Image.FromStream(new MemoryStream(tImg)); <----- Errors Here
imgO.Save(outPath, ImageFormat.Jpeg);
imgO.Dispose();
UPDATE:::: Let me re-phrase the issue. I am reading a BLOB ("IMAGE") from a database. It is in a DataRow (dr) The BLOB is over 30GB (hence why I need to write it out as a jpeg/bmp get it of the server. Writing it out as WriteAllBytes leaves it unreadable.