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 ...
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 ...
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 ...
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, ...
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 ...
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. ;-)
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 ...
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 ...
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 ...
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. ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
invalid-image-format × 17pset4 × 13
recover × 8
resize × 6
cs50x × 3
pset4recover × 2
invalid × 2
pset3 × 1
c × 1
segmentation-fault × 1
flask × 1
memory × 1
resize-less × 1
bitmap × 1
upload × 1
unsupportedformat × 1
50images × 1