drone1400 Posted April 14 Share Posted April 14 Hello. It seems I've ran into an issue using Paint.Net to save 24bit Bitmap (BMP) files... In short, the biSizeImage field of the Bitmap file header is always set to 0! I am using the latest version, 5.0.3, portable x64 from the github release page. I have attached an image showing the header files for a bitmap I saved using PDN. The highlighted line has the field I'm talking about. This doesn't seem to negatively impact anything I use the file for under windows... However, when I sent the file to a friend using some version of Linux (I don't know which one exactly), it would seem that this caused some problems for him and he was unable to use the image. Saving image using a different editor like MS Paint seems to work fine, and the biSizeImage field gets set correctly as expected... Quote Link to comment Share on other sites More sharing options...
toe_head2001 Posted April 14 Share Posted April 14 According to Microsoft's documentation, a value of 0 is acceptable for an uncompressed RGB bitmap. https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapinfoheader Your friend should submit a bug report for whatever software he is using. As a workaround, he can also re-encode the bitmap using a tool like Imagemagick, which is included by default with many GNU/Linux distros. 1 1 Quote My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Solution null54 Posted April 14 Solution Share Posted April 14 22 minutes ago, drone1400 said: However, when I sent the file to a friend using some version of Linux (I don't know which one exactly), it would seem that this caused some problems for him and he was unable to use the image. That sounds like a bug in that version of Linux. The BMP format specification allows biSizeImage to be 0 when biCompression is BI_RGB, see https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapinfoheader. 22 minutes ago, drone1400 said: Saving image using a different editor like MS Paint seems to work fine, and the biSizeImage field gets set correctly as expected... Paint.NET uses the BMP read/write functionality that is built-in to Windows (Windows Imaging Component). 1 1 Quote Plugin Pack | PSFilterPdn | Content Aware Fill | G'MIC | Paint Shop Pro Filetype | RAW Filetype | WebP Filetype The small increase in performance you get coding in C++ over C# is hardly enough to offset the headache of coding in the C++ language. ~BoltBait Link to comment Share on other sites More sharing options...
drone1400 Posted April 14 Author Share Posted April 14 Hmm, I see. Thank you both for the answers! Quote 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.