Welcome fellow students, register yourself and dive into asking questions, giving answers and helping the community learn with you.

resize.c and check50 error

0 votes
asked May 31, 2015 in Pset4 by sathyacse67 (250 points)
edited May 31, 2015 by sathyacse67

Here I have used image.bmp for resizing which has only one red pixel.

Then I have resized using both staff implementation and mine.

1. There is no error with xxd.

2. No error with diff.

3. No error with peek.

Everything seems fine!

But, Why am I getting error with check50?

Here is the Picture:

https://www.facebook.com/photo.php?fbid=1647946935435794&l=57d5a18ff4

1 Answer

0 votes
answered May 31, 2015 by Faïza Harbi (11,960 points)
First rule:

Check50 is not wrong, we are.

Second rule: no use of magic numbers (like 54 or 8 or 3 or...no).

Third rule: in a bmp file biheight can be negative, probably is, but you need it positive for... logical purpose: a height can be negative on a vectorial point of view, to indicate the direction, but not in general.

Fourth rule: Chances of your issue coming from how your resize(if you did resize) the header files BITMAPINFOHEADER BITMAPFILEHEADER are very high :)
Welcome to CS50xHelpers Q&A, where you can ask questions and receive answers from other members of the community.

197 questions

248 answers

217 comments

4,843 users

2 Online
0 Member And 2 Guest
...