So, I've figured out how to change the file headers and all. Works beautifully. The large image is the right size. I couldn't be happier. However, the large bmp image is just filled with neon green pixels. I would imagine that the part of my function that reads each pixel from the input file (pointer) and then writes it get stuck somewhere in a loop. I suppose it is not an infinite loop per se, since that would me I would spill over the allotted space for the bmp. I am really stuck here. My code follows below. Any and all hints would be greatly appreciated.
Your problem is with your
fseek() back to beginning of the current line each time you read all the pixels of this line. You should do this
n times for each line.
fseek() at the beginning of the next line after the n-th time you print a line.
Also, when you want to
fseek() backwards, the
offset parameter should be negative. In your case, your comment says that you
fseek() backwards, but the
offset is positive.
I hope this will help without spoiling the good part of figuring it out on your own. :D