Done making the resize work correctly, but my BITMAP output header differs from the output of the staff implementation in byte 35 (bi.biSizeImage). I've ran mine resize to multiply by 3 the small.bmp file, and the ran the staff implementation to do so, and all but that byte is equal in the output files. In my implementation i've calculated bi.biSizeImage as follows:
bi.biSizeImage = (bi.biWidth * factor * abs(bi.biHeight) * factor * 3) + padding2 * factor * 3;
where factor is the n passed argument. in this line i do not take into account the size of the Headers, but the difference between the values of byte 35 is larger than 54 (or 0x36). I've ran on the shell:
cmp -b staff2.bmp largetest2.bmp
and it outputs:
staff2.bmp largetest2.bmp differ: byte 35, line 1 is 374 M-| 224 M-^T
Am I doing something wrong?