I know my paddingOld & paddingNew values are correct. I also know all my header info is correct (checked student vs staff) check 50 passes the cases that do not need padding, but fails the ones that do.
here is my resize loop (in pseudo):
for (int i = 0, while i is less than height; i++)
{
if (i modulus of n does not = 0)
{
fseek(back a line);
}
// iterate over pixels in scanline
for (int j = 0; while j is less than width; j = j + n)
{
// temporary storage <- this is straight from copy.c
RGBTRIPLE triple; <- this is straight from copy.c
// read RGB triple from infile <- this is straight from copy.c
fread(&triple, sizeof(RGBTRIPLE), 1, inptr);
// resize horizontally
for (do n amount of times - standard loop)
{
// write RGB triple to outfile <- this is straight from copy.c
fwrite(&triple, sizeof(RGBTRIPLE), 1, outptr);
}
}
// skip over padding, if any <- this is straight from copy.c
fseek(inptr, paddingOld, SEEK_CUR);
// then add it back (to demonstrate how) <- this is straight from copy.c except I changed my value to paddingNew
for (int k = 0; k < paddingNew; k++)
{
fputc(0x00, outptr);
}
Any idea why my padding is not going in?