I have been working for a while now, and I have a few questions regarding the Resize problem set. My code makes sense to me intuitively, but I am sure I went wrong somewhere, as my output is clearly not as intended.
Here is a main question I have (along with a few others that I can't identify
What is the point of using the fread function and the old infile pointer rather than just using the new one and multiplying by the factor (resize scale)?
Here is an example of what I mean:
// Why do this:
BITMAPINFOHEADER bi, bi_new; fread(&bi, sizeof(BITMAPINFOHEADER), 1, inptr); bi_new = bf; bi_new.biWidth *= n; bi_new.biHeight *= n;
// Rather than just this:
BITMAPINFOHEADER bi; fread(&bi, sizeof(BITMAPINFOHEADER), 1, inptr); bi.biWidth *= n; bi.biHeight *= n;
Also, I believe I have this problem later when I only have one line for "padding". I am not sure what the purpose of having the old infile padding is, but I see many helpful solution advice that seem to incorporate it.
Aside from these questions, I would appreciate if you could check out my code here: https://gist.github.com/debner5/95a2b8d624e08609218f8c82ee9732c5
Thank you for the help!