Mar 27 2007

A generic error occurred in GDI+.

Tag: Programming & InternetDustin @ 3:24 pm

Sometime I run into errors that seem to make no sense and it takes me a while to find the answer as to why. Such is the case with this error. I wrote a routine in VB.NET to split a multi-page tiff file. Every once in a while, I would get this less than helpful error: “A generic error occurred in GDI+.” when calling the Image.Save() function.

Thanks to another frustrated user that found the solution I was able to see that sometime the folder I was sending files to did not exist. So rather GDI telling me that the save path did not exist it simply threw a generic error. Thanks!

So as long as you’re reading this, I might as well share the function that splits a multi-page tiff file. There are actually two functions. UniqueName is a recursive function that makes sure you don’t overwrite an existing file.
Continue reading “A generic error occurred in GDI+.”




Clicky Web Analytics