Actually I didn't understand the steps to complete resize.c and I'm completely lost, so I had to do some guesses about it.
I was able to get the right height and width of an image but the problem still with colors and padding.
this is what I did width the code
bf.bfSize *= n;
bi.biWidth = abs(bi.biWidth) * n;
bi.biHeight =abs(bi.biHeight) * n;
bi.biSizeImage *= n;