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
2
votes
1answer
4k views

Pset4 resize.c - bfsize & bisizeimage formulas

First of all thanks for your time. Taking cs50 through edX - struggling as all alone here and videos / lectures are burnt out for information - need real people! Online cs50 really does assume a lot ...
1
vote
4answers
1k views

check50 gives confusing results for pset4 resize

FOR CS50 STAFF ACTION: When I ran check50 against resize, I got a very confusing result. I've seen that others have seen the exact same result. Here's the problem - the output is giving negative ...
9
votes
1answer
4k views

How to Update bfSize in resize?

In resize problem, we have to update the headers of image. Which attributes should be updated and how do i update bfSize attribute?
0
votes
1answer
308 views

Error in my pset4 resize.c code

I have written this resize.c code it compiles but gives following error when run: runtime error: unsigned integer overflow: 18446744073709551613 * 3 cannot be represented in type 'unsigned long' ...
0
votes
1answer
158 views

pset4 Unsupported File Format

Been messing with this code for days, but when I was debugging it the program went from printing a distorted image to simply saying Unsupported File Format in the command line. Not sure where I'm ...
0
votes
1answer
121 views

Issue with padding when horizontally resizing. (pset4, resize (less))

So far, I have only implemented a horizontal resize to my code (I will implement the vertical resize once I have resolved this issue), and, though the code works properly on images such as large.bmp ...
0
votes
1answer
240 views

Pset4 odd behavior

I can't really figure out while my code end up making a weird version for the resize pset. It compiles and run but the image is not quite what it's suppose to be. Thanks for your support! [EDIT: ...
0
votes
2answers
123 views

Pset3 Resize Array not storing data properly

I'm not sure where the issue is here, but from the looks of debug I only store anything in my horizontal array (line) once despite seeing the debugger hitting that section of code properly. I assume I ...
0
votes
2answers
783 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 ...
3
votes
1answer
942 views

pset4 resize.c negation of 12 cannot be represented in type unsigned long

BITMAPFILEHEADER new_bf; BITMAPINFOHEADER new_bi; new_bf = bf; new_bi = bi; new_bi.biHeight = bi.biHeight*factor; new_bi.biWidth = bi.biWidth*factor; int padding = (4 - (bi.biWidth * sizeof(...
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 ...
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 ...
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
vote
1answer
932 views

PSET 4 - resize.c less

This is my code: // Resizes a BMP file pixel by pixel, given a factor n #include <stdio.h> #include <stdlib.h> #include "bmp.h" int main(int argc, char *argv[]) { // ensure proper ...
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 ...
1
vote
1answer
541 views

Pset4, resize, fseek, vertical scaling

I think I've gotten the horizontal resizing to work, however, I just don't get what's wrong with my vertical resizing. I've seen similar questions to mine, and I'm pretty sure my problem (assuming ...
0
votes
1answer
663 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
77 views

Pset4 resize(less) output issue, using third argument of fwrite

In Pset4 resize(less), I try to resize the width of image by using fwrite. gain is integer I use for resize factor. Originally I was doing like this. I put gain to the third argument of fwrite, and ...
0
votes
1answer
331 views

cs50 pset4 resize 're-copy' implementation

The code I wrote (using the pseudo-code of Zamyla's video on resize) make the image proper for some cases while not for others. I really need help in finding the flaw in the code. pseudo-code 1. ...
0
votes
2answers
898 views

Resize ( more comfortable )

int main int argc, char *argv[]) { // ensure proper usage if (argc != 4) { fprintf(stderr, "Usage: copy infile outfile\n"); return 1; } float f = atof(argv[1]); if(f<= 0.0 && f>=...
0
votes
2answers
374 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 ...
0
votes
2answers
407 views

pset4 resize.c appears to give same ouputs as staff solution but won't pass check50 or diff

I have been working on pset4 resize and it appears (to me at least) to work. I tested it by running smiley through the staff's implementation of resize with n = 4 and comparing results with my own ...
0
votes
3answers
359 views

pset4 resize.c check50 gives error even though resizing is done correctly

I used the peek command to check my headers using the command ~cs50/pset4/peek student.bmp staff.bmp and everything is alright and perfectly matches with the staff's implementation as follows : ~/...
0
votes
1answer
657 views

getting runtime error: unsigned integer overflow

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

resize fails check50 for final sizes other than 4x4

So after quite some fiddling I am at a place where, when resizing both small.bmp and smiley.bmp: 1) in- and out-files look the same; 2) peek matches the staff's implementation; and 3) "diff student....
0
votes
1answer
664 views

I don't understand what is going on my resize? Actually probably resize too

I have tried many days on resize. I take a break 1-2 week because of external reasons. I Watched zamyla many times and read many articles on stackexchange. but I could not understand. Here is my code. ...
0
votes
1answer
68 views

When I use peek, student.bmp is similar to staff.bmp but once my bmp gets resized the image is messed up

When I use peek student.bmp staff.bmp, it shows that the info header and the file header are being updated correctly. But If I use diff student.bmp staff.bmp I get Binary files student.bmp and ...
0
votes
1answer
436 views

pset4 resize what is wrong?2

Now it's a little bit better since: :) 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 correctly when n is 2 :( resizes ...
0
votes
1answer
289 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 '...
0
votes
1answer
225 views

resize code for pset4 not resizing properly

my resize code is not working properly. I am trying to resize small.bmp by a factor of 100. Here is my code: /** *resize.c * * Computer Science 50 * Problem Set 4 * * Resizes a BMP file by a ...
0
votes
1answer
74 views

Resize returns correct sized square, only top half is green and white center isn't there HELP!

Still working on this... headers are fine as no matter what I put in as factor the header files match with the staff implementation. Now I'm getting a square of the right size but only the top half is ...