mxz55

Paint.NET not really exporting images (of another origin) when no modifications were made

Recommended Posts

Hi, I think a certain kind of application behaviour is undesired;

 

- save an image using Windows paint (in my example, png)

- open the image under Paint.NET

- without making edits to the file, let Paint.NET save the file by same file location overwrite ("save", auto detect). 

 

Nothing will happen to the file, last modified date and file hash remains the same. While we know no visual edits have been made, Paint.NET is a whole different exporter, with different image and PNG format libraries, potentially producing a better file, adding different stuff in file metadata (png) such the fact it was saved using paint.NET, palette data which it doesn't if nothing gets changed.

 

What happens here is Paint.NET ignoring the file overwrite, if user is saving to the same location it opened the Windows Paint-exported file on. Paint.NET is just pretending that it's saving something in that case.

If however you go to "Save As", it will work as intended and generate a non-matching hash and use the Paint.NET format/add the metadata.

 

So basically at times Paint.NET chooses to be lazy, where there's no visual edits it will just respect the output file produced by another image editor. If this extends beyond MS paint created files, it can potentially be harmful because user of Paint.NET expects to produce a Paint.NET image file format for their own reasons. You can ask me why do you care about formats or image library version used, what are the quality improvements or changes; that is not an ordinary question, there can be a lot of purposes for many users to truly let Paint.NET write the file (like use some metadata written by it), which they also believe they are doing, its not the question what I will see visually different in the resulting images, but a question whether this is desired application behaviour, which I don't think it is.

 

Also I noticed in my test cases that sometimes it does write it from scratch using Paint.NET exporter, it depends on the complexion of the image it seems, like some color tones maybe paint.NET wants to structure differently in the format if it was saved using MS paint. So you can randomly get truly rewritten files using my reproduction steps. This could also explain why my attempts to get the same issue with formats other than PNG, kept producing truly rewritten files: i may not have come across certain color compositions/drawings yet that Paint.NET thinks it can preserve by relying on the old exact file. Just that doesn't say the issue is limited to PNG, my point.

Edited by mxz55

Share this post


Link to post
Share on other sites

I'm pretty sure this type of logic doesn't exist in Paint.NET. The file being written to isn't inspected to see if it's "the same". This would triple or quadruple the amount of I/O that needs to be done to save an image, and that wouldn't be okay in the general case. It would also use up a ton of memory, and the benefits wouldn't be there.

 

Have you tried this on other systems? Or maybe saving to a different disk? Maybe you have something else going on with your system. Like maybe OneDrive is obfuscating things, or some other kind of shell or file system plugin. It's also important to refresh the File Explorer window (press F5), as it doesn't always "catch" all the latest changes. (this used to work fine back in XP or Vista ... I think it got buggy in 8?)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now