title: Alternatives to System.Drawing for use with ASP.NET?
body: <p>After several days of tracking down bizarre GDI+ errors, I've stumbled across this little gem on <a href="http://msdn.microsoft.com/en-us/library/system.drawing.aspx" rel="nofollow noreferrer">MSDN</a>:</p>
  
  <blockquote>
    <p>Classes within the System.Drawing namespace are not supported for use within a Windows or ASP.NET service. Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions.</p>
  </blockquote>
  
  <p>I don't know whether "ASP.NET service" means "web application" in this context, but "diminished service performance" certainly seems to cover the random assortment of "A generic error occurred in GDI+" and "Out of memory" errors that my app is throwing - intermittent, non-reproducible errors reading and writing JPEG images that - in many cases - were actually created by System.Drawing.Imaging in the first place.</p>
  
  <p><strong>So - if GDI+ can't read and write JPEG files reliably in a Web app, what should I be using instead?</strong> </p>
  
  <p>I want users to be able to upload images (JPEG required, other formats nice-to-have), resample them <em>reliably</em>, and display useful error messages if anything goes wrong. Any ideas? Are the System.Media namespaces from WPF worth considering?</p>
  
  <p><strong>EDIT:</strong> Yeah, I know GDI+ works "most of the time". That's not good enough, because when it fails, it does so in a way that's impossible to isolate or recover from gracefully. I am not interested in examples of GDI+ code that works for you: I am looking for <strong>alternative libraries to use for image processing.</strong></p>