The code compiles, but the image file is now of an invalid or unsupported type. What did I do wrong here?
And if my calculation for the padding and image-size is wrong, let me know about that as well. Thanks.
Edit: I just updated the question.
I've found the correct formula for the biSizeImage and bfSize values and put those into the code, but I still get the same "unsupported or invalid file type" error as before.
Edit2: Made another update. I got some pseudocode from a short video by Zamyla about resize.c and I'm trying to use that here. It's the one for the recopy method, but I'm having trouble figuring out how to implement it correctly.
This is the pseudocode:
for each row
for n - 1 times
write pixels and padding to outfile
send infile cursor back
write pixels and padding to outfile
skip over infile padding
Also, if possible, I'd like to also like some help implementing the rewrite method (the one with the array). I didn't get what to put into the array and where to use it exactly, so some help there would be appreciated. I'll try to do whichever one is easier and simpler, but I need some help in understanding them and implementing them. Thanks.
Never mind. I'll make another post for the vertical resize.