In my solution biSize and biSizeImage are correct. Checking the headers and the data in the BMP shows correct re-sizing for n = 1, 2, 3, 4, ... Check50 returns:
:) resize.c and bmp.h exist
:) resize.c compiles
:( doesn't resize 1x1-pixel BMP when n is 1
:( resizes 1x1-pixel BMP to 2x2 correctly when n is 2
:( resizes 1x1-pixel BMP to 3x3 correctly when n is 3
:( resizes 1x1-pixel BMP to 4x4 correctly when n is 4
:( resizes 1x1-pixel BMP to 5x5 correctly when n is 5
:( resizes 2x2-pixel BMP to 4x4 correctly when n is 2
Also images display correctly in Image Viewer and in the application Pixelformer.
I think check50 is broken. Happy to shar my code if I knew how to do it :(
jharvard@appliance (~/Dropbox/pset4/bmp): ./resize 2 2by2.bmp staff.bmp
jharvard@appliance (~/Dropbox/pset4/bmp): ./resize 2 2by2.bmp student.bmp
jharvard@appliance (~/Dropbox/pset4/bmp): ./bmpinsp staff.bmp
BITMAPFILEHEADER <--> Filename = staff.bmp
bfType = 19778, bfSize = 102, bfReserved1 = 0, bfReserved2 = 0, bfOffBits = 54
BITMAPINFOHEADER <--> Filename = staff.bmp
biSize = 40, biWidth = 4, biHeight = -4, biPlanes = 1, biBitCount = 24, biCompression = 0
biSizeImage = 48, biXPelsPerMeter = 2834, biYPelsPerMeter = 2834
biClrUsed = 0, biClrImportant = 0
jharvard@appliance (~/Dropbox/pset4/bmp): ./bmpinsp student.bmp
BITMAPFILEHEADER <--> Filename = student.bmp
bfType = 19778, bfSize = 102, bfReserved1 = 0, bfReserved2 = 0, bfOffBits = 54
BITMAPINFOHEADER <--> Filename = student.bmp
biSize = 40, biWidth = 4, biHeight = -4, biPlanes = 1, biBitCount = 24, biCompression = 0
biSizeImage = 48, biXPelsPerMeter = 2834, biYPelsPerMeter = 2834
biClrUsed = 0, biClrImportant = 0
jharvard@appliance (~/Dropbox/pset4/bmp): make resize
clang -ggdb3 -O0 -std=c99 -Wall -Werror resize.c -lcs50 -lm -o resize
jharvard@appliance (~/Dropbox/pset4/bmp): check50 2014.fall.pset4.resize bmp.h resize.c
jharvard@appliance (~/Dropbox/pset4/bmp): ./bmpinsp 2by2.bmp
BITMAPFILEHEADER <--> Filename = 2by2.bmp
bfType = 19778, bfSize = 70, bfReserved1 = 0, bfReserved2 = 0, bfOffBits = 54
BITMAPINFOHEADER <--> Filename = 2by2.bmp
biSize = 40, biWidth = 2, biHeight = -2, biPlanes = 1, biBitCount = 24, biCompression = 0
biSizeImage = 16, biXPelsPerMeter = 2834, biYPelsPerMeter = 2834
biClrUsed = 0, biClrImportant = 0
jharvard@appliance (~/Dropbox/pset4/bmp): ^C
jharvard@appliance (~/Dropbox/pset4/bmp): xxd -c 24 -g 3 -s 54 2by2.bmp
0000036: ff00ee ff00ee 0000ff 00eeff 00ee00 00 ................
jharvard@appliance (~/Dropbox/pset4/bmp): xxd -c 24 -g 3 -s 54 staff.bmp
0000036: ff00ee ff00ee ff00ee ff00ee ff00ee ff00ee ff00ee ff00ee ........................
000004e: ff00ee ff00ee ff00ee ff00ee ff00ee ff00ee ff00ee ff00ee ........................
jharvard@appliance (~/Dropbox/pset4/bmp): xxd -c 24 -g 3 -s 54 student.bmp
0000036: ff00ee ff00ee ff00ee ff00ee ff00ee ff00ee ff00ee ff00ee ........................
000004e: ff00ee ff00ee ff00ee ff00ee ff00ee ff00ee ff00ee ff00ee ........................