BMP file orientation: vertical or inverted?

I am working on a program to resize a BMP file and save it in a new file. I noticed that some BMPs are stored completely in reverse order, while others are simply stored upright. Therefore, I made two decisions to handle both cases. My question is: how do I know if an IFV is stored upright or upside down? So that I can decide which solution to use instead of trying to use both solutions with each BMP!

+4
source share
1 answer

The answer lies within the BITMAPINFOHEADER structure.

From: http://msdn.microsoft.com/en-us/library/windows/desktop/dd318229(v=vs.85).aspx

RGB, biHeight , DIB . biHeight , - DIB .

+7

Source: https://habr.com/ru/post/1695803/