0

As far as I can tell my program works as intended. When I execute my program and compare its result with the same result produced by the sample program they are identical in every way. They look the same, peek tells me they have identical metadata, even when I click on the properties window they each are the exact same number of bytes, no mater how much I scale up.

Therefore, my metadata adjusts correctly, and I have to think I wrote the padding correctly since the file would look off if I didn't and they would take up a differing amount of bytes.

xxd printout Check50 peek

Why is Check50 telling me I'm failing?!

2
  • check50 is well tested and almost certainly not failing. You've used peek to compare headers and say that the images 'look the same'. An image may appear to be the same, but have very small differences. Have you done a byte-by-byte comparison of the output file to the sample file? xxd will display the bytes of each file for you. the diff program will also compare two files to see if they differ. Finally, it would help if you posted the check50 output so we could see exactly what fails.
    – Cliff B
    Commented Oct 14, 2015 at 16:03
  • I've edited my original post to include the xxd printout, peek's comparison, and the check50 error messages. I used smiley.bmp as the sample bmp and resized it by a factor of two, per one of check50's conditions. As you can see, the metadata is identical and the bytes of the bmps themselves are identical. What gives?! Commented Oct 15, 2015 at 14:24

1 Answer 1

0

Thanks for helping Cliff. I realized after I sent you that image of the xxd readout that smiley.bmp doesn't have any padding, not matter how you resize it. Because of that, using it creates a false positive when testing your program.

Small.bmp does have padding and now I'm seeing my program's errors.

Tip for everyone: DON'T USE SMILEY.BMP WHEN TESTING YOUR PROGRAM!!!!

2
  • Actually, you should use files that do and don't have padding to thoroughly test for the reasons you saw. Also, scaling a file by something other than 1 or a factor of 4 will change the padding needed no matter whether the original has padding or not. A file with no padding as input will produce a file with padding if you resize to 2, 3, 5, etc.
    – Cliff B
    Commented Oct 15, 2015 at 16:07
  • Well I did additional tests with my program as written using smiley.bmp and it did produce acceptable results with scaling of 2, 3, 4, 5, 7, and 15 both in visual output as well as metadata. I believe you are correct to test your program both with files that have padding along with those that don't, but it does appear that using smiley.bmp will give false positives for testing padding no matter the scale. (At least with the code I wrote.) Commented Oct 15, 2015 at 16:47

You must log in to answer this question.

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