0

I'm working on the CS50 pset3 problem resize (less comfortable). It looks like the resize is working, but I seem to be adding a lot of extra bytes to the header. Looking at the image itself it looks like 'the end' is off.

bitmap image after resize n=3 hexadecimal result of n=3

The image shows the result of n = 3. But I need to reset the 'start with byte' to 222, instead of 54. I can't figure out where I'm going wrong... Can anybody give me some insight?

The complete code can be found here.

0
1

While it won't affect how this particular image would be displayed, you somehow lost the sign of the height (don't assign the absolute value times n, but the original height, as it is still stored in bi.biHeight, times n).

The fwrite loop should come after your fread loop. Move the } from line 125 up, to line 113 or so. Your for (int l = ... loop should be on the same indentation level as for (int j = ....

1
  • I've figured out the abs-problem in the meantime. But the } really did the trick! Thank you so much!
    – denelan
    Dec 5 '19 at 21:40

You must log in to answer this question.

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