Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 4847
1 vote
Accepted

pset 3resize (less) how to store RGBTRIPLES in array

It's actually a structure, or a struct that is defined in the bmp.h file: /** * RGBTRIPLE * * This structure describes a color consisting of relative intensities of * red, green, and blue. * * …
Cliff B's user avatar
  • 69.3k
2 votes
Accepted

CS50 - Pset3 - Resize (Less)

I would wager that you looked at the images but not at the raw data in the files. Since the header is correct, it tells any bmp viewer to display the amount of data that should be in the image, but if …
Cliff B's user avatar
  • 69.3k
0 votes
Accepted

Resize less comfortable (recopy method) need help

The main problem is that the code doesn't copy the struct data from the original header structs bi and bf to the new ones, new_bi or new_bf. That means that the headers that are written to the output …
Cliff B's user avatar
  • 69.3k
1 vote
Accepted

Is scan line not moving to the next line? I'm badly stuck. Please advice

Several issues here. First, look at the code that expands the line horizontally: for (j = 0; j < biSmall.biWidth; j++) { // read RGB triple from infile fread( …
Cliff B's user avatar
  • 69.3k
0 votes

What does the loop for padding do in Resize(less)?

This is code from the original copy.c program that will later be used in resize. An fseek call will cause the file pointer to change position in a file. You should google it and study the details. I …
Cliff B's user avatar
  • 69.3k
0 votes

resize less help needed

So close indeed!!! I'll give you a hint. When you're working with an open file, are you sure that you're using values appropriate for the right file? In other words, input file vars when working wi …
Cliff B's user avatar
  • 69.3k
0 votes

Invalid or Unsupported Image Format

I'm going to assume that you haven't added any code yet to scale the actual image data yet. I ran your code and it seems to be correctly handling the headers. Perhaps you're executing a different ve …
Cliff B's user avatar
  • 69.3k
1 vote
Accepted

pset 4 resize (less)

So, I see that it calculates the padding for the input file. Where is the padding calculation for the output file? They are not necessarily the same, especially if the scaling factor != 1. Also, bi …
Cliff B's user avatar
  • 69.3k
2 votes
Accepted

Could someone please tell me where I'm going wrong here in resize-less(pset4)?

There are two major issue. First, the code is using biWidth and biHeight for the output file to control reading from the input file. Second, there's no actual code to handle vertical scaling. Per …
Cliff B's user avatar
  • 69.3k
1 vote

resize(less) am baffled dont know whats changed pls help

You've clearly looked at the images generated, but have you looked at the raw image data using the xxd tool? It's a lot more revealing because you can see patterns in the raw data! There are a couple …
Cliff B's user avatar
  • 69.3k
1 vote
Accepted

[Pset 4 resize (less comfortable)]: problem with getting the correct RBG output

Actually, you don't get the correct image size. The output image data is several times larger than it should be. The intent of the code posted above is to read in a pixel (an RGBTRIPLE), copy it to a …
Cliff B's user avatar
  • 69.3k
1 vote
Accepted

Rewrite method in Resize (less) is printing wrong large.bmp

First, there are errors in calculating header data. That should be easy to fix. The design logic for vertical scaling is totally flawed. Understand that images are not stored in two dimensions. The d …
Cliff B's user avatar
  • 69.3k
1 vote
Accepted

CS50 - Pset3 - Resize (Less) - Wrong Bitmap Size

The code will work when the scaling factor is 1, but not otherwise. The problem is straightforward. The code calculates the new biHeight and biWidth values, but it doesn't plug them back into the …
Cliff B's user avatar
  • 69.3k
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 an …
Cliff B's user avatar
  • 69.3k
0 votes
Accepted

Pset 4 resize - problems with resizing

This line has a couple of problems: scanline[pixel + n] = triple; Let's say that the scale factor, n, is 3. Now, let's walk through what happens. The code starts by reading the first pixe …
Cliff B's user avatar
  • 69.3k

15 30 50 per page