0

I have been working on pset4 resize and it appears (to me at least) to work. I tested it by running smiley through the staff's implementation of resize with n = 4 and comparing results with my own program (same inputs of course).

However, diff states the files differ (smiley1.bmp is mine, smiley2.bmp is staff's), and the program doesn't pass check50 for n > 1.

Nevertheless, the bmp headers look the same using peek (bi.biSizeImage are both 00000c00 btw), and the BMPs themselves look the same.

Any ideas where I might be messing up? I can post snippets of my code if that would help.

Thanks for reading!

diff and peek outsSmileyBMPs

1

Looking at the visual representation of the files is not always a good test because check50 checks every byte of the output files. You should use the tools referenced in the exercise and check the actual binary content of the files produced by your program and by the staff implementation. Very simply, if there's any difference, either in size or in content, then you have an issue.

If the headers are a perfect match, what about the contents of the bmp image itself? Do you have any extra bytes on the end? are there any differences within the image area? Are the paddings correct?

In short, every bit within the file needs to be right. Ultimately, you need to check every bit in your output file against the staff example.

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

0

Fixed most of it now! I was using the output biHeight instead of the input biHeight for iteration.

I was typing up that I figured it out just when you shot a response.

Thanks!

You must log in to answer this question.

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