4 votes
Accepted

Pset4 Resize.c Array Overstepping

After edit: For reference, here is the pseudocode from the walkthrough: for each row       for each pixel          ...
DinoCoderSaurus's user avatar
2 votes
Accepted

Pset4 - resize : stuck in resizing vertically (Yes, i have read other q&a regarding this topic, but still can't figure out the solution)

fseek(inptr, 0 - padding_ori - horiz, SEEK_CUR); Interesting way to do this. When the loop finishes, isn't horiz equal to bi.biWidth? Now, when you call fseek(), what units does it use to move? ...
Cliff B's user avatar
  • 68.8k
1 vote
Accepted

Problems with vertical resize Pset4

fseek does not require an unsigned long, the signature is int fseek(FILE *stream, long offset, int whence); The runtime error stems from this calculation -((bi.biWidth * sizeof(RGBTRIPLE))-1). ...
DinoCoderSaurus's user avatar
1 vote

Not able to get the correct enlarged image in resize

You have problems in two areas. First, you have header values that are incorrectly calculated. Run ./resize 1 small.bmp s2.bmp and compare the two files using peek. They should be identical. You ...
Cliff B's user avatar
  • 68.8k
1 vote
Accepted

PSET4 Invalid File Format when going from n = 1 to n = 2

Have you tried the steps described in the problem statement's "Testing" chapter? https://docs.cs50.net/2018/x/psets/4/resize/less/resize.html#testing The total file size is part of the ...
Blauelf's user avatar
  • 20.9k
1 vote
Accepted

pset4 resize(less) vertical

Looks like too many loops. Why is there an outer loop that processed the entire input file n times? Most of the pieces are there, but reprocessing the entire file more than once won't accomplish ...
Cliff B's user avatar
  • 68.8k
1 vote
Accepted

PSET 4 (Resize)-- Vertical Scaling

First, I'm assuming that n is the scaling factor. Look carefully at what the code is doing. It starts by creating array[n], an array of RGBTRIPLEs that can hold n pixels. Then, it stores n copies of ...
Cliff B's user avatar
  • 68.8k
1 vote
Accepted

CS50 Pset4 Resize - Vertical Sizing

Have you looked at the raw image data using xxd? The image data for anything larger than n=1 is far too much! The code is using the output file's biHeight and biWidth to control reading the input ...
Cliff B's user avatar
  • 68.8k

Only top scored, non community-wiki answers of a minimum length are eligible