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 ...
user avatar
  • 63.1k
2 votes
Accepted

Resize Invalid Image Format

There is a significant flaw in the code. The header vars are changed (probably correctly) but then stored in the original headers for the input file, bi, bf. Then the output file headers are written ...
user avatar
  • 63.1k
2 votes
Accepted

Pset3 - Resize (less confortable)

Your output file is too large, larger than the header claims. Use input height, not output height for the outermost for loop. Not sure this can explain the problem you describe, especially those ...
user avatar
  • 20.7k
2 votes
Accepted

PSET4 Recover spits out 50 images but they're all invalid

Effectively your algorithm is correct, but there is a small mess with the pointers, you declare a pointer to the buffer in which it will be written: uint8_t *buffer_ptr = malloc(FAT_BLOCK_SIZE); So, ...
user avatar
  • 5,172
2 votes
Accepted

Recover code makes 000.jpg to 049.jpg, but jpgs are corrupt

Haven't seen this problem in a few months. I understand your frustration because it's a very subtle problem to find! ;-) This is a good example of why it's important to run a program through a ...
user avatar
  • 63.1k
1 vote
Accepted

pset4 / recover / invalid or unsupported image format

See anything wrong here? fwrite(openFile, BLOCKSIZE, 1, openFile); If this answers your question, please click on the check mark to accept. Let's keep up on forum mainteance. ;-)
user avatar
  • 63.1k
1 vote
Accepted

Pset4 Resize: Invalid Format

Along with using 1 and not n to write headers (no matter how large the file is scaled up, the headers are only written out once each), some of the header fields are wrong. Many of the header fields ...
user avatar
  • 63.1k
1 vote
Accepted

Pset4 recover invalid or unsupported

At first read PSET4 RECOVER Can't Open JPEGS, I Have Tried Everything Please HELP! about sizeof(buffer) Then, do something with the whole logic of your code. Write it in your language (english or ...
user avatar
  • 1,139
1 vote
Accepted

Pset4: Resize: Unsupported image format

There are a number of errors in the code that need to be resolved and other issues that haven't even been coded for. There are fields in the headers that haven't been updated. The padding for the ...
user avatar
  • 63.1k
1 vote
Accepted

My code seems to be correct but when i run the program i can't open the output file

If you had used the xxd tool to look at the output file, you would see that most of the header data is wrong. If you run the program multiple times, that incorrect data also changes from run to run. ...
user avatar
  • 63.1k

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