Jump to content

Large Image Save Bug


Eric Smith

Recommended Posts

I've been messing around with some very large images lately (size 30,000 x 30,000 and larger) and have noticed a reproducible but on saving - when saving an entire row of pixels will be deleted out of the image.

 

Surest way I've been able to reproduce the bug is to create an image 30,000 wide by 38,000 tall. I've used other dimensions, but this bug is 100% reproducible using these dimensions on my machine. Leaving the entire canvas white Background works fine for this, but it happens regardless of image contents. Duplicate the Background layer for good measure; this brings the total canvas size up to 8.5GB of memory necessary. When you save and close the image then reopen it the entire 2210 row of pixels is blank. You can use the Magic Wand tool to select the background pixels to see the missing row of pixels clearly, for whatever reason the row is gone.

Link to comment
Share on other sites

I didn't extensively test what formats or how many layers would show this bug, but it is consistently reproducable in .pdn format with more than 1 layer.

Edited by Eric Smith
Link to comment
Share on other sites

If you could come up with a list of steps to reproduce this, that would help a lot :)

 

Like maybe, create a 40K x 40K image, do these specific things, save it, then re-open it in another tab and see that row #XYZ is just blank for some reason

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

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

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Also, I may have seen this just last night. I have a Mandelbrot fractal rendering in a 64K x 64K PDN file ... and I think I saw one of the rows was blank for some reason.

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

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

forumSig_bmwE60.jpg

Link to comment
Share on other sites

10 hours ago, Rick Brewster said:

If you could come up with a list of steps to reproduce this, that would help a lot :)

 

Like maybe, create a 40K x 40K image, do these specific things, save it, then re-open it in another tab and see that row #XYZ is just blank for some reason

I pretty much listed all the steps in my initial post, but here it is again explicitly described, using the latest release version (4.0.18):
1) Create a new image 30,000 px wide by 38,000 px tall. This should automatically create a "Background" layer that is solid white pixels.
2) Duplicate the layer. You can use Magic Wand to select either layer and it should select the entire image on either layer

3) Save file as .pdn
4) Close Paint.net, reopen it, then open the .pdn file
5) Use the Magic Wand tool to select anywhere on either Background layer and a row of pixels will be missing, replaced with transparent pixels, so the Magic Wand will only select part of the image.

This has shown up in three different files I was working on with a couple different sizes over 30k px.

 

Link to comment
Share on other sites

Yes, y=2210 is the row that blanks for me. I'm not sure if it's always y=2210 - as I said I didn't extensively test this (rendering time just makes it impracticable for me to test for the sake of testing) - but for the 30K x 38K x 2 layer it is always y=2210. In at least one image the blank started part-way through. Attempting to reproduce this on an image 42k x 37700 x 2 layers using the same procedures I used above the missing pixels start at x=30176 y=12134 and continues all the way across that row and into the next row, where a line 3472 px long is missing starting at x=0 y=12135. 

 

 

Edited by Eric Smith
Link to comment
Share on other sites

Okay I found and fixed the problem. 4.0.20 will have the fix.

 

Both saving and loading had the same bug, which was truncation of a 64-bit value to a 32-bit one at the wrong point in the calculation.

 

This bug has been around ... probably forever. It's not new.

  • Upvote 3

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

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

forumSig_bmwE60.jpg

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.

Guest
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...