When I use peek student.bmp staff.bmp, it shows that the info header and the file header are being updated correctly.

enter image description here

  • But If I use diff student.bmp staff.bmp

  • I get Binary files student.bmp and staff.bmp differ

If I run my code ./resize 44 small.bmp student.bmp, small.bmp get resized but everything gets messed up.

enter image description here


Most of your problems revolve around padding. At the beginning of your for loop, you have:

        fseek(inptr, 54 + oldBiWidth * i, SEEK_SET);

This doesn't account for the padding in the input file, so after the first line, you're out of synch.

Also, you have to make sure that you use the right padding var with the right file (input file vs. output file).

This should push you in the right direction.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

  • I made some improvements, at least the resized image looks a little bit similar to the small version. But I'm still confused on what I'm doing wrong.
    – AziCode
    Feb 23 '16 at 22:39

You must log in to answer this question.

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