Topic: Bug loading some BMP files in Image Analyzer

I notice it doesn't work with some BMP image files. Those files have a negative value for image height, in the BitmapInfoHeader part of the file. You see, the height field being a negative number actually means that the image is flipped vertically compared to normal BMP image data orientation (first bytes of image data being at the top of the image, instead of at the bottom of the image). BMP is a bit unusual compared to other image file formats. The BMP file standard's NORMAL orientation is with the top of the image being stored LAST. So in order to be more similar to other image formats (top line of pixels stored FIRST), you need to have a negative value for height. The negative value for height, signals the fact that the BMP file stores the top line of pixels first. All of the image processing software I write, for example, ALWAYS uses a negative value for image height when saving a BMP file, this is so that the actual image data is stored in a more useful orientation, making it much easier, with fewer lines of code, to convert between BMP files that my software saves, and other formats (most of which always store the top line of pixels first in the file). Furthermore, its easier to design software that always has the top pixels first in the pixel array, and this is how my brain thinks, when writing software. Image top=first bytes, image bottom=last bytes, so quite naturally, I write code that populates a byte array in this order, and I save that byte array to a BMP file when I want to store the image, always making sure that the Height field in the BMP file's BitmapInfoHeader is always negative.

Unfortunately, Image Analyzer has a problem loading such BMP files, when the height value is negative. While it does properly create an image window with the correct dimensions, the loaded image is completely black. This is incorrect behavior. The image window should instead contain the image that was stored in the BMP file. And that means that BMP files saved by all of the software that I've written, won't load in Image Analyzer. I have to first load them into another program (such as MS Paint, or Gimp) and then re-save them, so that they get around this bug in Image Analyzer. And yes it is a bug, because a properly working BMP file loader routine in a program will check the sign of the Height field in the header, so that it can handle either orientation of the image data.

2

Re: Bug loading some BMP files in Image Analyzer

Could you please provide an example of such a file?

Michael Vinther

> software developer <

Re: Bug loading some BMP files in Image Analyzer

I can't post an image file of the BMP format to this forum. Your built-in image attachment feature on this forum automatically converts any image I post to JPG. But it must remain in the exact BMP file for it to have this effect. As I said, most things (including this online BMP to JPG converter) handle the BMP file correctly, but Image Analyzer does not. And when it converts it, it makes a working JPG file, so I can't use it to demonstrate how Image Analyzer is failing with my BMP file.

Is there some image hosting site I can use, that will let me upload BMP files, and will host them for linking to on other sites, without converting the image to JPG?

4

Re: Bug loading some BMP files in Image Analyzer

You can send it to my e-mail

Michael Vinther

> software developer <

5

Re: Bug loading some BMP files in Image Analyzer

Thanks, this has been fixed in the latest beta

Michael Vinther

> software developer <