0

I know others have had a similar problem and I have tried to find my error but I see no difference between my bmp file and the staff.bmp. Since reddit seems very quiet these days I am posting here also. I tested several factor numbers. I get a sad face on 2x2 bmp when n is 2- here is the check50 result enter image description here

I compared the headers using peek and everything is green.enter image description here

I compared the hex values using xxd and also the same including the headers.enter image description here

I was so happy to finally get resize working but now I do not have any idea where my problem is...

Any help would be greatly appreciated.

2 Answers 2

1

So I figured this out. I tried the smiley.bmp and indeed my by.SizeImage and bf.size were off. Some small changes fixed everything. For those interested you should think carefully about what values are in bytes and what are in pixels. Also if you the you don't know why you fail check50 try different size bmp files until you see where it is failing.

1

Good afternoon!

also you can create images with different size by STAFF solution

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

and also by using this tool:

 xxd -c 12 -g 3 -s 54 staff.bmp
 xxd -c 12 -g 3 -s 54 student.bmp

Peek will help you to compare headers and last command will show image, it's more easier to compare.

hope it will help you.

You must log in to answer this question.

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