GDI Issue
-
Hi, I have a strange problem (also difficult to explain but here goes) - basically I have a program that scans a email account (which receives faxes as tiff images as attatchments) when the program finds a new email it gets the tif saves it to a mySql database and also saves each individual image to the database. But sometimes one of the seperate images is corrupt i.e. I can see it in the database (blob editor - image) but i cant work with it at all - I can save it using mySql front but if i try and open the image it says drawing failed. If I try and use it in my code - byte[] MyData = (byte[])dataread["fileData"]; System.IO.MemoryStream mem = new System.IO.MemoryStream(MyData); mem.Flush(); System.Drawing.Image i = System.Drawing.Image.FromStream(mem); i.Save(mem,System.Drawing.Imaging.ImageFormat.Gif); it will give a gdi exception(a generic exception has occured) when i try create a image from the memoryStream another strange thing is that whenever I get an image like this the length of the byte array is always 74240. Also when I view the image in the tiff I can see no problems with it. Any ideas/help would be greatly appreciated. Thanks. Gavirj
-
Hi, I have a strange problem (also difficult to explain but here goes) - basically I have a program that scans a email account (which receives faxes as tiff images as attatchments) when the program finds a new email it gets the tif saves it to a mySql database and also saves each individual image to the database. But sometimes one of the seperate images is corrupt i.e. I can see it in the database (blob editor - image) but i cant work with it at all - I can save it using mySql front but if i try and open the image it says drawing failed. If I try and use it in my code - byte[] MyData = (byte[])dataread["fileData"]; System.IO.MemoryStream mem = new System.IO.MemoryStream(MyData); mem.Flush(); System.Drawing.Image i = System.Drawing.Image.FromStream(mem); i.Save(mem,System.Drawing.Imaging.ImageFormat.Gif); it will give a gdi exception(a generic exception has occured) when i try create a image from the memoryStream another strange thing is that whenever I get an image like this the length of the byte array is always 74240. Also when I view the image in the tiff I can see no problems with it. Any ideas/help would be greatly appreciated. Thanks. Gavirj
Anybody??