1

I compiled the grayscale image in helpers.c with make filter without any errors correctly and check50 also correctly and passes all creterea But when I enter [ ./filter -g infile.bmp outfile.bmp ] it shows could not open infile.bmp. Any Idees why am getting this message. Thanks

~/pset4/filter/ $ ./filter -g infile.bmp outfile.bmp
Could not open infile.bmp.

check50 results:

:) helpers.c exists
:) filter compiles
:) grayscale correctly filters single pixel with whole number average
:) grayscale correctly filters single pixel without whole number average
:) grayscale leaves alone pixels that are already gray
:) grayscale correctly filters simple 3x3 image
:) grayscale correctly filters more complex 3x3 image
:) grayscale correctly filters 4x4 image

2 Answers 2

1

This doesn't look like a code problem. Since check50 passes, the code is ok.

Most likely (I'll put the odds at over 98%), the file infile.bmp either doesn't exist in the directory where you're running the program, or it is corrupted.

Check to see that the file infile.bmp exists in the current directory and open it to see that it contains an image.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

2
  • Thank you for your feedback, I read the documentation again I found that to get an grayscale image you have to run it with a different command include image folder and the name of the image like: [ ./filter -g images/yard.bmp out.bmp ]. This commands created new grayscale image and was the correct scale. But thank you angaine for your support.
    – Matrix
    Commented May 23, 2021 at 10:25
  • I forgot to mention. How do I know the name of the other images that bellong to Blure, Reflect and Sepia??? so I can enter the right command?? Thanks in advance.
    – Matrix
    Commented May 23, 2021 at 10:34
4

After reading the documentation again, I found that to get an grayscale image you have to run it with a different command include image folder and the name of the image like: [ ./filter -g images/yard.bmp out.bmp ]. This commands created new grayscale image and was the correct scale.

You must log in to answer this question.

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