I noticed that the built-in file viewer doesn't seem to show the contents of certain BMP files correctly. Looking at it more closely, I believe this only happens when run length endcoding is used. Specifically when the biCompression value in the file header is equal to BI_RLE4 (value of 2) for 4 bits per pixel images or BI_RLE8 (value of 1) for 8bpp images. I've attached an example bitmap file which demonstrates this. It is viewable in Paint properly as two checkboxes side by side, the first unchecked and the second checked.
According to the file's header, it is not RLE compressed, so it may not be written correctly. (The BMP format is like a puzzle, with a lot of special cases, and a lot of software gets the unusual cases wrong. This may be a case of that in the software that wrote the BMP.)
If we can work out a reliable way to decode it we may still be able to add compatibility with it, even if it is incorrect, as long as it doesn't break other BMPs (especially valid BMPs).
The file is incorrect (and not RLE compressed, FWIW), as the bfOffBits value points to the start of the color palette when it is supposed to point to the start of the bitmap.
We have made a code change for the next version to make it detect this when it can, and ignore bfOffBits if it looks invalid, but you should also inform whoever made the software that wrote the bitmap as they are writing invalid bitmaps which may cause problems with other programs.
Leo, thanks for the quick reply. It turns out that this was due to my mistakes, sorry about that!
First, I sent the wrong bmp. The one I had meant to send did have RLE but you're correct about the one I attached.
Second, I created the bmp file with my own program and I got two things wrong - the bfSize was set to 0x266 which is wrong. That itself doesn't cause a rendering problem. The bfOffBits value I had fixed as 0x36 since I thought all BMPs have 54-byte headers. It should have been 0x76 for this one because of the color palette.
So I guess MS Paint and Paint.NET both compensate for the invalid bfOffBits but Directory Opus does not currently (until the next version), which was the problem. I apologize and thank you for the thorough response!