I've been stuck with the pset3 for a long time now and can't figure out why my code isn't working; it compiles fine but doesn't produce an image except for the factor 1. Could someone point me in the right direction?

Thanks a ton in advance!

  • Link leads nowhere. Maybe put it on gist.github.com as a "secret gist"?
    – Blauelf
    Feb 15 '19 at 16:45
  • Oops. Thanks. Should work now. :)
    – Ivo
    Feb 15 '19 at 16:47
  • Does this work for a resize factor of 1? If so, go implement the bitmap resize. And don't use output padding for input and output.
    – Blauelf
    Feb 15 '19 at 16:53
  • Thanks. I'm not entirely clear, however, what you mean by "implement the bitmap resize", could you clarify that?
    – Ivo
    Feb 15 '19 at 16:55
  • The headers describe file and bitmap. You claim your new bitmap is bigger now. But you essentially have the bitmap copy routine from copy.c, not rescaling anything, which would be the other part.
    – Blauelf
    Feb 15 '19 at 17:33

There are some issues here, but let's attack the main problem. You can sort out anything else that remains, depending on how you recode the program.

Think about what the code does. Simply put, it reads in a pixel (RGBTRIPLE) and writes it out immediately. It does nothing to scale up, i.e., write out each pixel n times. It will ONLY write each pixel ONCE. There's also no code to duplicate each LINE of pixels n times, to scale vertically.

In short, while the code will work with a scaling factor of 1, there's no code to support scaling up to anything greater than 1. Time to add code to complete the assignment.

Also, there's an error in the header data when n>1 that'll give you a clue to another problem. ;-)

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

You must log in to answer this question.

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