Jump to content

Large file not loading

Recommended Posts

I went through the listed troubleshooting steps, but I still get this error when I try to load a large PNG file.


Application version: paint.net 4.1.5

System.OverflowException: Overflow error.
   at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData)
   at PaintDotNet.Data.PngFileType.OnLoad(Stream input) in D:\src\pdn\src\PaintDotNet\Data\PngFileType.cs:line 114
   at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\src\Data\FileType.cs:line 496
   at PaintDotNet.Functional.Func.Eval[T1,TRet](Func`2 f, T1 arg1) in D:\src\pdn\src\Base\Functional\Func.cs:line 158


The PNG file is the new large Hubble image of M33.  It is 1.51GB, 32073x41147 on the drive. 

I have 16 GB of system memory and I can create a new canvas of that size and draw on it, so I assume I should be able to load an image of that size?




Possibly the image is corrupt, but I have tried downloading it twice, and Windows was able to generate a thumbnail for it (eventually!).  The half-resolution image is able to load successfully.


The image is located at http://hubblesite.org/image/4305/news_release/2019-01


Thanks for any help.



Link to comment
Share on other sites



I don't think the system memory size is the problem as much as processing speed. I have a 6 core processor  with 4 CPUs and 2 GPUs. It took several minutes to save a 32k x 42k image of a white screen. Are you using an i7 or a Ryzen 8 core?

It took ~20 minutes to save and created a 1.24 MB PNG  at an 8 bit color depth file.

Edited by HyReZ
inserting additional information


Link to comment
Share on other sites

It's actually GDI+, which uses WIC, which can't handle an image of that size. I'm not yet clear whether it's a GDI+ limitation or a WIC limitation.


I'm able to load a PDN that is 65,535 x 65,535 pixels. However, I can't save that to a PNG because GDI+ (aka System.Drawing) can't handle it.


I plan to address this at some point, but right now I'm not sure when that'll happen.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...