Questions tagged [resize]

resize.c, one of the assignments in Problem Set 4, will require you to scale a bitmap image by a certain factor (making it 2, 3, or n times as large).

Filter by
Sorted by
Tagged with
0
votes
1answer
365 views

resize.c black pixels appearing out of nowhere

I've finally managed to get the new headers to write correctly, but the BMP itself is not being created properly. Black pixels (0x000000) are appearing in my output files and I'm not sure where my ...
1
vote
2answers
814 views

cs50x pset4 resize

Something's wrong here. Check50 doesn't like files that look fine to me. Here's my command line: jharvard@appliance (~/cs50x/pset4/bmp): ./resize 5 singleton.bmp qw.bmp Here's what check50 says: ...
0
votes
1answer
104 views

Resize gives black vertical stripes, which are thin when n is small, but getting wider and wider with increasing a factor of n

Photos are legible, but with this vertical black stripes // determine biHeight, biWight and padding for infile scanlines int InPadding = (4 - (bi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4; int ...
0
votes
0answers
200 views

pset4 resize check50 error "expected bmp.h to exist" and it does exist

Check50 can't see my bmp.h file, its there and resize works correctly, any ideas?? https://sandbox.cs50.net/checks/b5be44d692954fb98c07d29961fa76a7 I should add, I had a mishap a few days ago where ...
0
votes
1answer
2k views

Need Help in pset 4 resize. CAN'T understand what's wrong

#include <stdio.h> #include <stdlib.h> #include "bmp.h" int main(int argc, char* argv[]) { // ensure proper usage if (argc != 4) { printf("Usage: ./resize n infile ...
0
votes
2answers
375 views

Pset5 resize works but fails check50 TODO- bytes and headers match staff bmp file

I know others have had a similar problem and I have tried to find my error but I see no difference between my bmp file and the staff.bmp. Since reddit seems very quiet these days I am posting here ...
2
votes
1answer
2k views

Resize's Padding Issue

My resize for pset4 finally worked and I can resize the small.bmp (that green square) properly. however it doesn't work for all the check50 requirements(except for compiling and running) and i don't ...
0
votes
2answers
456 views

Pset4: Check50 does not work with my resize program

In my solution biSize and biSizeImage are correct. Checking the headers and the data in the BMP shows correct re-sizing for n = 1, 2, 3, 4, ... Check50 returns: :) resize.c and bmp.h exist :) resize....
1
vote
2answers
660 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)....
1
vote
1answer
684 views

Resize - breaks when output padding > 0

I think I'm having a lot of the same issues that some of my other classmates are having with resize.c, so was wondering if you guys could take a look at my code and help me see where I'm messing up. ...
0
votes
0answers
773 views

bmp image has unsupported header size

my program runs but large.bmp can't be displayed with error as "bmp image has unsupported header size". Below the extract of my code that I think related to the error, please help see what's wrong ...
0
votes
1answer
665 views

Resize.c fails the check "resizes 2x2-pixel BMP to 4x4 correctly when n is 2"

Check50 is failing my code and I am out of options to troubleshoot this. Any help from the community is greatly appreciated. I have compared different resizing factors for small.bmp and smiley.bmp ...
0
votes
1answer
204 views

PSET5 Resize returns image of jubbled colours ... not sure what's wrong!

For PSET5 Resize.c, I have tried implementing the following with n being the resize factor inputted by the user. The code compiles but returns an image of an conglumeration of colours (or a corrupted ...
1
vote
0answers
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 ...
0
votes
1answer
606 views

Resize.c not working in some cases

I'm struggling with resize.c for quite some time. I've come to the point where it perfectly resizes sometimes (for example, small.bmp with factor 5) but sometimes it doesnt(for example, small.bmp with ...
3
votes
1answer
1k views

pset 5 resize vertically - use of fseek

I am struggling with the vertical resizing using the recopy approach. I read a pseudocode in an answer to another question in this forum and am trying to code it. I feel I am near but something is not ...
0
votes
0answers
97 views

Resize.c Lines are shifted

I have been trying to debug my code for days now with little success. The enlarged image seems shifted when I open it. The white pixels in the middle are skewed off center, though my file is the ...
2
votes
1answer
95 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 ...
0
votes
1answer
161 views

pset5 resize correct, cs50 check indicates error and prints two "TODO's"

"When I run my implementation of resize.c in check50, there are two "TODO's" in red at the bottom of some sections. Does anyone know what this means? (My programs output is identical to the staff's ...
1
vote
1answer
284 views

check50 has 2 TODO's in red for resize.c

When I run my implementation of resize.c in check50, there are two "TODO's" in red at the bottom of some sections. Does anyone know what this means? (My programs output is identical to the staff's ...
-1
votes
1answer
160 views

resizing problem

check50 shows that i cant resize 1x1px image by 2 and 3, others are fine and i don't know why....can anyone give me some hints. thanks. My headers are fine as i checked... // read infile's ...
0
votes
0answers
154 views

Unable to solve resize.c

Hello guys I am stuck at pset-5 resize.c problem. Here is what i have done: 1) For updating header, in width and height, ave multiplied them by n and for Image size, subtracted the padding of input ...
0
votes
1answer
434 views

resize vertically is not working properly

i take the re-copy approach guys and badly stuck in that problem .. everything my code is fine just writing pixel is wrong somewhere. i'm posting my writing snippet of my resize please give me some ...
-1
votes
1answer
335 views

Problem with resize

I'm with the pset5 and my code doesn't work and I don't know why. Can somebody help me? Here is my code: //resize headers BITMAPFILEHEADER bfNew; BITMAPINFOHEADER biNew; biNew.biWidth = bi.biWidth * ...
0
votes
0answers
166 views

Resize vertically not working. Help!

Okay, my image is coming out a bit shifted and with two dark spots. please help me pinpoint whats going wrong // iterate over infile's scanlines for (int i = 0, biHeight = abs(bi_o.biHeight); i &...
1
vote
1answer
1k views

check50 reports resize as incorrect for 1, 2, 3, 5 for seemingly correct code

is the check50 report for my code : jharvard@appliance (~/Dropbox/pset5/bmp): check50 2014/x/pset5/resize bmp.h resize.c :) resize.c and bmp.h exist :) resize.c compiles :( doesn't resize 1x1-pixel ...
0
votes
1answer
522 views

"Unsupported file format" error when checking the format of BMP files

pset5 is the first pset so far that I've really struggled to understand. I've written the code, but I can't test the algorithms because everytime I run it I get "Unsupported file format" // ensure ...
0
votes
2answers
785 views

resize vertically doesn't work

First of all I know there are a lot of other questions like this but I have looked at all of them. They have helped a lot but I am still stuck. I can't see anything logically wrong with my code, but ...
0
votes
1answer
1k views

Updating header info in resize

I know I have to do this: //resize headers biWidth = biWidth * n biHeight = biHeight * n biSizeImage = (biHeight*3) * (biWidth*3) + padding bfSize = biSizeImage + 54 But I don't know ...
0
votes
2answers
675 views

pset5 resize re-copy method

I'm trying to resize bmp files in Pset 5 using the re-copy method. However, it seems as though I'm calculating the headers wrongly and I'm also not implementing the for loop where I repeat the ...
0
votes
1answer
212 views

Conceptualising resizing in pset5

I've just solved the resizing part of pset5 without completely understanding what is happening during the reading of the infile and writing of the outfile bit. To clarify my question, here is my code ...
0
votes
1answer
179 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 ...
0
votes
1answer
294 views

Serious problems with pset5 resize - alterations to headers [closed]

I'm really struggling with this pset, and resize especially - I have gone through the code, but I don't know what I am missing. I could really use someone to take a look at the code and point me in ...
0
votes
0answers
182 views

check50 fails my pset 5 resize.c even though output is identical to staff's implementation

I ran diff with the bmp file outputted by my resize program and the same bmp file outputted by the staff's implementation, and it says that the two files are identical; but check50 says it doesn't ...
0
votes
1answer
557 views

How to implement re-copy method for resize?

I have been through my code a few times aloud and on paper and have hit a brick wall. I'd rather get a hold on the re-copy method before bottling it and trying the re-write method. // iterate over ...
0
votes
1answer
292 views

pset5 resize segmentation fault?

I am getting a segmentation fault when I run this program, and am fairly sure that the problem is in the third for loop, where I try to copy the bytes from *pixel to *line, duplicating each byte '...
1
vote
1answer
2k views

resize: having header problems

My program compiles and everything, but when I try to open up the image it says the image has "bogus header files". I'm not sure what I'm doing wrong. Here's some of my code: // read infile's ...
9
votes
2answers
2k views

How does fread progress through each byte in copy.c?

In copy.c (and the other apps using the same start code), how does freed know to read one byte after another? It seems to just do it automatically. Eg, this will read each byte, from first until bi....
1
vote
1answer
247 views

what is happening in pset5 resize hacker edition?

I implemented the staff's solution to compress a bmp by a factor say 0.5 and compared the compressed version with the original bmp using xxd command. I expected it copy just half of rgb triples from ...
0
votes
1answer
2k views

How to Resize an Image Vertically?

I'm able to resize a given .bmp horizontally, but the code for vertical resizing is not working. Here is my code for vertical expansion. // resize vertically //move pointer to start of scanline of ...

1
9 10 11 12
13