tags:

views:

24

answers:

1

Hello,

I have a bmp file. I have read in its header that its size is "56 5A 03" which means 0x035A56. However, every Hex editor that I use to see the contents of that file shows me 0x038000 bytes for this file.

  • My general question is that does bmp file contains a trailer/footer?
  • in the mentioned case, what is the problem?

Thanks.

+1  A: 

The Wikipedia page on the BMP format describes the format, and describes that field in the header as "the image size. This is the size of the raw bitmap data (see below), and should not be confused with the file size." which means it's likely not counting the padding between pixels.

Andrew Koester
Thank you. I have studied Wikipedia. where it calculated RowSize and then FileSize, padding data is considered for each row. I believe there is not any other padding in bmp file. when I calculated the size of my file manually using that formula (considering the padding data), it was exactly 0x035A56. But if I use the 'properties' of my file using right click, it says the file size is 0x038000. Is there any other padding?and I think according to Wiki, you agree that there is no trailer/footer. right?thanks.
Shadi
Depending on which value you're looking at, the Properties dialog may be showing you the size on disk, which involves the block size of the drive it's stored on. It doesn't look like there is any padding, but no, there should not be a trailer on the BMP file format. However, since the header dictates what the renderer needs to display the image, there could potentially be extra unused data at the end.
Andrew Koester
thanks. However, it seems a little strange to me.
Shadi