BMP file has extra padding. Is this byte alignment?

New Here ,
May 25, 2020 May 25, 2020

Copy link to clipboard

Copied

Hi,

When saving a 24-bit BMP from Photohop I'm getting two '00' bytes at the end of the file. I can't see anything that accounts for this in the BMP spec. When I save the same image in MS Paint those two bytes are missing.

The extra bytes bring the total file size up to a multiple of 4 bytes. Is this Photoshop padding the BMP to ensure the whole file is 4-byte aligned? I know BMPs have padding per scan line, but this is not that. My test BMP is constructed such that there is no padding per scan line, and I've confirmed this in a hex editor. Just the two '00' bytes at the end of the file.

Just curios as it means InfoHeader->SizeImage is incorrect when dealing with the file exported from Photoshop. It's too large as it includes these extra bytes. Again, the same image exported from MS Paint doesn't include these. (Though paint isn't writing the InfoHeader->SizeImage property at all from what I can see!)

I've attached an image showing the same image saved as a 24-bit BMP through both MS Paint and Photoshop. Could anyone explain where these extra bytes come from?
hex.png
Thanks!

TOPICS
Import and export, Problem or error

Views

353

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 09, 2020 Jun 09, 2020

Copy link to clipboard

Copied

BUMP: Anyone have any information on this? Should I mark this as a bug if no-one has an explanation as to why?

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 24, 2021 Mar 24, 2021

Copy link to clipboard

Copied

Hey,

 

I noted the same issue, but never got any answers from anyone. Also, I tried to contact Adobe directly about this issue, but nobody will react to the issue.

 

This sucks, and I just ignored those two bytes to get going for now.

 

best regarts.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines