The following line throws an OutOfMemoryException when loading a large image
System.Drawing.Image img = System.Drawing.Image.FromFile(filepath);
I tried with a 8280x6208 8,76 MB image file and lots of other smaller images, that works fine.
But when I try with a 10328x7760 6,44 MB image file, it throws the OutOfMemoryException.
I also tried opening the file in photoshop and save it with worse quality (1,32 MB), but with the same dimensions, it throws the OutOfMemoryException.
I tried upscaling another smaller image to 10328x7760 and that throws the OutOfMemoryException too.
So I'm pretty sure it's an actual out of memory problem and my question is:
Can I increase the memory somehow?
I'm using Windows 8.1 64 bit with 8GB RAM, Visual Studio 2013 with IIS Express. It's a Web Application project.
EDIT: I don't think it's a format issue as suggested, I tried with a 10000x10000 black image and a 5000x5000 black image. The 10000 throws OOM, the 5000 don't.