0

:) 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

1

1 Answer 1

2

Try this command and publish the results of the last one:

./resize 4 small.bmp student.bmp
~cs50/pset5/resize 4 small.bmp staff.bmp
~cs50/pset5/peek student.bmp staff.bmp

Edit:

As I thought - it was just a little mistake with the update of bfSize and bi.biSizeImage (it happened the same to me):

Updated bi.biSizeImage = (Updated bi.biWidth * sizeof(RGBTRIPLE) + padding) * absolute value of Updated bi.biHeight
AND
bf.bfSize = (Updated bi.biSizeImage) + 54

1
  • As I thought it was just a little mistake with the update of bfSize and bi.biSizeImage (it happened the same to me): <Updated bi.biSizeImage = (Updated bi.biWidth * sizeof(RGBTRIPLE) + padding) * absolute value of Updated bi.biHeight> AND <bf.bfSize = (Updated bi.biSizeImage) + 54>
    – supeindesu
    Jun 25, 2014 at 21:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .