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:


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.

284 questions

248 answers


6,607 users

2 Online
0 Member And 2 Guest