woofster Posted April 3, 2009 Share Posted April 3, 2009 I have been fighting this for.... tooo long. We have some CMS software that terminates whenever we try to insert a png that was saved with paint.net. We discovered that the Microsoft Photo Editor and ifranview created png files that worked OK, but Paint.net ... trouble. After extensive research, we believe we found the answer: Paint.NET does not save the image DPI into the PHYS chunk in PNG files. This section of the PNG file is documented here: http://www.libpng.org/pub/png/book/chapter11.html (search for "Physical Pixel Dimensions (pHYs)") Any chance support for this PNG element will be added to Paint.NET ? Thanks! Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted April 3, 2009 Share Posted April 3, 2009 All I know is that I hand the DPI* to the PNG codec in System.Drawing and whatever happens there is how it works. As far as I knew, this was just plopped into the EXIF data. Does regular Paint (mspaint.exe) work? I think it uses the same GDI+ codec. * Actually, internally we store DPU (dots-per-unit) and DPU Units (pixel, centimeter, inch). When DPU Unit is pixel, then DPU is always 1, and cannot be changed. But, the document format itself disallows setting this to pixels -- that enumeration value is reserved for the UI. (as far as I recall) Quote 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 More sharing options...
woofster Posted April 3, 2009 Author Share Posted April 3, 2009 mspaint.exe.... let's please not set the bar so loooooooooow.... Macromedia fireworks, photoshop, and ifranview all save png files with the "phys" block in it. mspaint.exe and paint.net do not save this block. Unfortunately, some apps (esp for web rendering) look for it... and some blow up when it isn't there. Some example png files attached (see the file names for explanation). You can open the files with a hex editor and look for the "phys" tag (only present in the fireworks and ifranview examples -- oops, can't add a 4th example, so no ifranview example on this post). Quote Link to comment Share on other sites More sharing options...
woofster Posted April 3, 2009 Author Share Posted April 3, 2009 here is the ifranview example Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted April 5, 2009 Share Posted April 5, 2009 Well, the DPI should be there but I suppose it's just stored in the EXIF data. I don't have any plans right now to change how Paint.NET saves PNG files. I'd have to completely replace the PNG codec (GDI+ has minimal support for, to be honest, everything), and that's not something to be done lightly. Quote 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 More sharing options...
woofster Posted April 5, 2009 Author Share Posted April 5, 2009 Bummer. I had been migrating toward paint.net, but think I will have to switch gears and move to fireworks instead. Quote Link to comment Share on other sites More sharing options...
david.atwell Posted April 5, 2009 Share Posted April 5, 2009 Is this something a filetype plugin could fix? Quote The Doctor: There was a goblin, or a trickster, or a warrior... A nameless, terrible thing, soaked in the blood of a billion galaxies. The most feared being in all the cosmos. And nothing could stop it, or hold it, or reason with it. One day it would just drop out of the sky and tear down your world.Amy: But how did it end up in there?The Doctor: You know fairy tales. A good wizard tricked it.River Song: I hate good wizards in fairy tales; they always turn out to be him. Link to comment Share on other sites More sharing options...
pyrochild Posted April 5, 2009 Share Posted April 5, 2009 I'm certainly no expert when it comes to FileType plugins, but I'm thinking no. You would have to make the plugin use a different extension (such as .pngx or something) and rename any files appropriately. Otherwise, Paint.NET's built-in PNG filetype would take precedence. Quote ambigram signature by Kemaru [i write plugins and stuff] If you like a post, upvote it! Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.