I am trying to write a code to read a BMP file so I am trying to read BMP header(s). I am using a test image from some code library but it looks, like the structure doesn't correspond with the information about BMP image structure on Wikipedia Wikipedia BMP structure , especially in part, where should be offset stored ("The offset, i.e. starting address, of the byte where the bitmap image data (pixel array) can be found. ") in the table on Wikipedia as the start of the image looks like following:
00000000: 424d ea88 0000 0000 0000 3604 0000 2800 BM........6...(.
00000010: 0000 e300 0000 9500 0000 0100 0800 0000 ................
00000020: 0000 0000 0000 0000 0000 0000 0000 0001 ................
00000030: 0000 0000 0000 2c2a 2c00 4c8f 6900 252e ......,*,.L.i.%.
00000040: 9900 385b 4700 4c54 9700 98c9 a000 7a8c ..8[G.LT......z.
So there is clear that the image starts on 36h and not 436h as is should look like according to Wikipedia - looks for me like the valid information has 1 Byte, not 4 Bytes. So I tried to find another source of the information about the header and I've found only the same information as is described in the mentioned article.
I thought that I have wrong image stored, so I decided to open it via Gimp and store it as the new-one, but it looks like the header has the same structure, just start of the image is moved.
00000000: 424d 2e89 0000 0000 0000 7a04 0000 6c00 BM........z...l.
00000010: 0000 e300 0000 9500 0000 0100 0800 0000 ................
00000020: 0000 b484 0000 130b 0000 130b 0000 0001 ................
00000030: 0000 0001 0000 4247 5273 0000 0000 0000 ......BGRs......
00000040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000060: 0000 0000 0000 0000 0000 0200 0000 0000 ................
00000070: 0000 0000 0000 0000 0000 2c2a 2c00 4c8f ..........,*,.L.
00000080: 6900 252e 9900 385b 4700 4c54 9700 98c9 i.%...8[G.LT....
So not only that Gimp reads the header with no issue, but it even creates header of the same type. But according to the documentation it looks like the binary part should be stored on 436h, respective 47Ah as there should be little endian used. I am clearly missing something there but I can't get the point as the different sources fastgraph.com BMP header docs.fileformat.com BMP structure shows the same offsets but reality differs here for some reason. Can you move me forward here?
PS: I would paste here original image, but it looks like the image is automatically exported to png format.