Some headers allow height and width to be negative (for instance BITMAPINFOHEADER) and height is often negative as the pixel array goes from bottom to top.
Interpreting it as unsigned integer gives an enormous number that does not make any sense.
As this differs from one version of header to another, it might be a good idea to have various interpretation options that matches the header version.
Some headers allow height and width to be negative (for instance
BITMAPINFOHEADER
) and height is often negative as the pixel array goes from bottom to top. Interpreting it as unsigned integer gives an enormous number that does not make any sense. As this differs from one version of header to another, it might be a good idea to have various interpretation options that matches the header version.