Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
1 answer
103 views

Why should we assume that the size of the output BMP file does not exceed 4 GB?

Per the spec of pset5, You’re welcome to get started by copying (yet again) copy.c and naming the copy resize.c. But spend some time thinking about what it means to resize a BMP. (You may ...
RexYuan's user avatar
  • 309
1 vote
1 answer
2k views

pset4 resize, invalid or unsupported image format

I've looked up previous questions and seen people have also tended to change bfSize as well, but when I did this the image was still unsupported so I changed it back. As such nothing in ...
roncook's user avatar
  • 115
1 vote
2 answers
729 views

How to create a BMP image that is compatible with resize?

Using my resize on small.bmp and smiley.bmp then with cs50's peek, I get the exact same values as with the staff's solution for BITMAPFILEHEADER and BITMAPINFOHEADER (I tested with different n values)....
Touten's user avatar
  • 23
1 vote
1 answer
935 views

what is wrong with my resize?

My resize program isn't working. I have narrowed it down to the padding, but cannot find what is incorrect. It resizes images that don't need padding perfectly (multiples of 4), and the header ...
moonkey69420's user avatar
1 vote
1 answer
104 views

Pset 4 Resize makes a very colorful picture (not green!)--padding problem?

Well, it looks like I'm not the only one having issues with padding (I suspect that's my problem). Specifically, if I test my version of resize with an enlargement factor of 2 (using small.bmp as ...
Rhinofish's user avatar
1 vote
0 answers
209 views

pset5: Resize does not consistently work

I am having a problem with resize. I can resize smiley.bmp perfectly at X1, X2, and X10, but not for factors between 2 and 10--I just get an abstract blob of colors. I assume this has something to do ...
PaulJ's user avatar
  • 11
0 votes
1 answer
265 views

Having trouble with PSet4 resize problem

I'm having difficulty with PSet4's resize problem right now. I feel like I've implemented it correctly, but the result is a colour-mish-mash which ends half way through the file. My solution was to ...
Andrew's user avatar
  • 105
0 votes
1 answer
59 views

Odd IDE behavior during pset4

I just finished writing the code for the resize problem of pset4. When I run my code in the debugger, everything turns out right, but when I run it simply in the terminal, the computer complains about ...
Christophe Caron's user avatar
0 votes
1 answer
434 views

PS4 Resize makes random colors

So, I'm in the midst of PS4 resize, and while I know I'm still figuring out an array of different things, when i currently perform the resize (even if I "resize" it to the same size) it seems to be ...
Brian Hodges's user avatar
0 votes
1 answer
84 views

PSET3 Resize (more comfortable), resizing f > 1 correctly, but pixels are different colors. Does not work when f < 1

**Relevant code is after comment: // iterate over infile's scanlines This code is able to make a new larger bmp with the correct dimensions, but the pixels are not the same color as the original bmp. ...
Amanda Ramirez's user avatar
0 votes
1 answer
38 views

CS50 pset3 i want to resize this image, code is working for some and not for others? Can anyone tell me whats the problem?

int n = atoi(argv[1]); // read infile's BITMAPFILEHEADER BITMAPFILEHEADER bf,bfR; fread(&bf, sizeof(BITMAPFILEHEADER), 1, inptr); bfR = bf; // read infile's BITMAPINFOHEADER BITMAPINFOHEADER bi,...
Rohit Jain's user avatar
0 votes
2 answers
59 views

can't pass check50

My code works correctly. large creates and correctly. but it simply won't pass check50 /** * copy.c * * Computer Science 50 * Problem Set 4 * * Copies a BMP piece by piece, just because. */ #...
Chinebuah's user avatar
0 votes
1 answer
605 views

pset4 resize: how to copy a row

Just spent 2 days for figuring out how fread(), fwrite() and fseek() works. I tried to use "Rewrite" method from Zamyla's video for vertycal resizing: - Remember pixels in array (first written row of ...
Semyon Pilyukov's user avatar
0 votes
1 answer
494 views

pset4 malloc() approach. Help with size of buffer

I'm having some trouble with the malloc function. I want to make a buffer the size of the new row I'm going to write in the resized file, and this is my approach. I must say that bi.biWidth is ...
Alejandro Aristizábal's user avatar
0 votes
1 answer
246 views

Pset4 Resize Error

When I try to run the program, I get the message "file size limit exceeded." After looking over my code many times, I can't figure out what might be going wrong?? /** * copy.c * * Computer Science 50 ...
Andrea Perry's user avatar
0 votes
1 answer
145 views

pset4 resize premature end of file encountered

This is extremely frustrating. I've been having header problems for a while, getting various error messages. However, using xxd I can see that when I run resize with n=2, biSizeImage is indeed 120, ...
noneofyourbusiness's user avatar
0 votes
1 answer
733 views

pset4 - resize.c - Cannot get vertical resizing to work

and thanks for helping me with my problem. I have managed to get horizontal resizing to work within my resizing program, but every time I attempt the next step, I keep failing. Here is the code of the ...
jackyboy633's user avatar
0 votes
1 answer
112 views

Resize not working (writes RGBTRIPLE too many times)

In resize.c, the image created in my resized image is a tiny image with a black blotch in the middle, regardless of whether I use small.bmp or smiley.bmp as input. When I run xxd, the header in the ...
Yami Medina's user avatar
0 votes
1 answer
98 views

Why is biSizeImage a random number?

I found this anomaly when running peek, then confirmed with gdb that bi.biSizeImage is getting set to 4294966864 when it should be 432.
jhschwartz's user avatar
0 votes
1 answer
517 views

resize pset 4 confused on number of things

I think I have the headers correct except for the new bf.Size not to sure on that one. I am having real problems with resizing the bitmap and I can't figure out what it is, any hints or pointers in ...
JV305's user avatar
  • 29
0 votes
1 answer
183 views

pset5 resize, not enough memory to load bmp

Resize is compiling but the outfile bmp doesn't open. It gives me an error "Not enough memory to load bmp". Does anybody have any idea why that might be happening? Where am I going wrong? Here's my ...
hunter's user avatar
  • 31
0 votes
1 answer
62 views

Resize Adding Too Much Padding

I'm really struggling with resize on pset4. My loop is adding too much padding, I think by a factor of the scale. I'm still working on the horizontal stretch portion of the program. I'm pretty sure ...
Wes Basinger's user avatar
0 votes
1 answer
79 views

PLEASE HELP!! cs50 pset4 resize.C complies but cannot resize 1x1 correctly. ,AND large.bmp says"invalid image or format"

Here's the code I finally have. but the issue is the cs50 check says : :) resize.c and bmp.h exist :) resize.c compiles :( doesn't resize 1x1-pixel BMP when n is 1 :( resizes 1x1-pixel BMP to 2x2 ...
qingming's user avatar
0 votes
1 answer
118 views

pset 4, resize.c is not working

Here is the code for resize.c I am stuck for quite some time now and i am not able to figure out where i am wrong. please help. bi.biHeight = height*n; bi.biWidth = width*n; // determine new padding ...
Kishore Vasan's user avatar