This patch fixes some issues with loading of indexed BMP files.
(1) It used an invalid offset to determine where the BMP data starts. This information is provided by the file info header, which was previously ignored entirely.
(2) It read from the palette as RGB even though it really contains BGR data.
(3) It did not support images of bit depths 1, 2 and 4. Some programs I worked with produce such images automatically when they notice that there are only a few colours in the image, so it would be nice if Blender supported this.
I can provide test .bmp files if needed.