0

pset5 is the first pset so far that I've really struggled to understand. I've written the code, but I can't test the algorithms because everytime I run it I get "Unsupported file format"

 // ensure infile is (likely) a 24-bit uncompressed BMP 4.0
if (bf.bfType != 0x4d42 || bf.bfOffBits != 54 || bi.biSize != 40 || 
    bi.biBitCount != 24 || bi.biCompression != 0)
{
    fclose(outptr);
    fclose(inptr);
    fprintf(stderr, "Unsupported file format.\n");
    return 5;
}

Since check50 returns the same thing, I know it's not a problem with the bmp I'm using. Also, when using gdb it tells me the 2nd command line argument is "undefined" so I can't even go through it that way. Since I don't know where the problem is can I post my whole code, or send it to someone? Any help would be greatly appreciated.

6
  • What is the command that you're executing in the terminal to run resize? – Kareem Sep 13 '14 at 19:32
  • ./resize n infile outfile (or specifically ./resize 4 ./clue.bmp ./resized.bmp) – kayles Sep 13 '14 at 20:13
  • Everything seems to be correct for me. Maybe try re-downloading the pset files! – Kareem Sep 13 '14 at 20:48
  • Just re-downloaded and it now runs normally. Thanks you! I was going insane trying to figure out what the problem was. – kayles Sep 13 '14 at 21:13
  • I don't know maybe the first time you downloaded the files some of these files were not downloaded correctly, you lost some data or something. – Kareem Sep 13 '14 at 22:19
2

At @Kareem's suggestion, the question's author solved their problem by re-downloading the problem set files.

Maybe try re-downloading the pset files! – Kareem Sep 13 at 20:48

Just re-downloaded and it now runs normally. Thanks you! I was going insane trying to figure out what the problem was. – kayles Sep 13 at 21:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .