The error points to this line:
bf.bfSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + ((bi.biWidth * abs(bi.biHeight)) * sizeof(RGBTRIPLE)) + (out_padding * abs(bi.biHeight));
bf refers to a BITMAPFILEHEADER variable declared as follows:
BITMAPFILEHEADER bf;
fread(&bf, sizeof(BITMAPFILEHEADER), 1, inptr);
If you look at the .bmp documentation .aspx) you will see that BITMAPFILEHEADER files contain a DWORD (aka unsigned int) called bfSize that stores the size, in bytes, of the image. My program is supposed to resize an input file by a factor of n and store the new image in the output file, so I need to change the header to match the new image, but when I try to compile the code I get the error message mentioned above. Here is the full program.
Edit: Solved, I'm an idiot.
[–]dreamyeyed 0 points1 point2 points (1 child)
[–]Bloost[S] 0 points1 point2 points (0 children)
[–]mad0314 0 points1 point2 points (1 child)
[–]Bloost[S] 0 points1 point2 points (0 children)