Skip to main content
2 votes
Accepted

pset4- recover invalid or unsupported image format

Look at the following code: fwrite(inptr, 512, 1, img); Why are you writing something back to the input file? Even if it was supposed to go to the output file, why would the same block be ...
Cliff B's user avatar
  • 69k
1 vote

Problem with CS50 Pset3 Resize Less

You've declared a new header struct, but you never gave it any values // write outfile's BITMAPFILEHEADER BITMAPFILEHEADER outfile_bf; fwrite(&outfile_bf, sizeof(outfile_bf), 1, outptr); ...
curiouskiwi's user avatar
  • 18.7k
1 vote
Accepted

Problem with CS50 Pset3 Resize Less

Hmmm..... After the code creates the output file headers, do you think it would be useful to load/copy the values from the input file headers into the output file headers? // write outfile's ...
Cliff B's user avatar
  • 69k
1 vote
Accepted

recover.c unsupported image format after opening

Looks like a typo in the fwrite statements. You want to write the block that was just read into buffer (not memCard).
DinoCoderSaurus's user avatar
1 vote
Accepted

pset4 resize, file format problem before resizing

Perhaps you should very carefully review the header fields that you are changing. Many have quite similar names, even the same name in both bi and bf headers. You should also use the peek tool to ...
Cliff B's user avatar
  • 69k
1 vote

Invalid or Unsupported format - pset4 (resize)

There are a number of errors in the code. It creates struct vars for the input file headers and reads the headers from the input file (correct), but then creates two more headers and reads again from ...
Cliff B's user avatar
  • 69k

Only top scored, non community-wiki answers of a minimum length are eligible