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).

104 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0 votes
0 answers
331 views

problem with rewrite method in resize

The code compiles without a problem, outfile is of correct size, but my rewrite "function" isn't working properly. Can anybody help me, cause i'm stuck for 4 days already on this problem? PS don't pay ...
faust's user avatar
  • 1
0 votes
1 answer
190 views

pset4 resize :- storing horizontal scanline into array

So I declared an array of type rgbtriple as in RGBTRIPLE* buffer = malloc(sizeof(bi.biWidth)); and now i want to read in each pixel n times, so using a for loop like for(int m = 0; m < n ; n++) ...
user14992's user avatar
0 votes
1 answer
61 views

segmentation fault with my resize code of pset4

i don't understand why I am getting segmentation fault here is the code : http://pastebin.com/KME0ts09
Ketan Verma's user avatar
0 votes
1 answer
82 views

problems with my resize code of pset4

guys i don't understand what is wrong with my code : http://pastebin.com/xbjCYNCX i am trying to copy the pixels to a 2-d pinter array of structures, skipping the padding and then write it to the ...
Ketan Verma's user avatar
0 votes
0 answers
345 views

help with resize vertical (more comfortable)

https://www.facebook.com/groups/cs50/permalink/833598930120487/ I'm doing resize (more) and I need help with pattern and loop structure for f in [0,1.0]. my program works fine with f > 1
Maulik's user avatar
  • 101
0 votes
1 answer
129 views

Why does my output image look like this for pset4 resize?

Please see code below, I know my fseek is incorrect, as im offseting the size of RGBTRIPLE whereas I want to offset the size of the buffer. /** * copy.c * * Computer Science 50 * Problem Set ...
i'i'i'i'i'i'i'i'i'i's user avatar
0 votes
2 answers
558 views

PSET4 Resize (More) - Downsizing, which pixels to skip, where to readup?

I'm doing PSET4 (More) and fixing the downsizing portion. Given a 8 x 8 pixel image. Downsizing to a 4 x 4 pixel image. n = 0.5 So I'm starting with 64 pixels. New image must have 16 pixels. I ...
James Goldstein's user avatar
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
303 views

pset4 resize.c fseek problem

I have a problem with vertical resizing that's been driving me crazy for weeks. When I run ./resize 4 smiley.bmp x.bmp I get this: When I debug the program, the variables increase as they should, but ...
Daniil Ganco's user avatar
0 votes
1 answer
26 views

pset4: Resize no error seen when compiling still unsupported image format

The problem that I'm facing even while using the debugger is I can't seem to possibly find where I'm going wrong. Please can someone identify where I might be going wrong/ or is my understood logic ...
Syed Mohammad Sualeh Ali's user avatar
0 votes
1 answer
54 views

problem with resize cs50check giving out red errors in some test

the program is working correctly resizes perfectly (atleast i think) but cs50 check gives out an error on todos on some test please guide https://sandbox.cs50.net/checks/...
Ashfaq seyad's user avatar
0 votes
0 answers
62 views

can someone please help me with my resize code

This is my code for resize.c. The problem is that when I pass in the small.bmp file and any factor n to which I want to resize this bmp file, the output is a bmp file with the same size as small.bmp ...
SSS's user avatar
  • 3
0 votes
1 answer
79 views

pset4 help resize

I'm so stuck. The resizing works, but the colors in the output file don't come back in the right order. Can anyone help me with this? int main(int argc, char *argv[]) { // ensure proper usage ...
ocaro's user avatar
  • 1
0 votes
2 answers
2k views

cs50 pset4 resize help!

I am stuck at this problem for a long time now. I understand the logic as : the width, padding and length of the image are different. so calculate them differently. Read each pixel from the input ...
Aniket Pathak's user avatar
0 votes
1 answer
160 views

CS50 resize.c image problems... Whats wrong?

I'm having trouble with my program. It compiles and everything but 1) large.bmp appears as an "Invalid or Unsupported Image Format" and 2) I fail all the Check50 tests. I've been editing my code for ...
Soubie Im's user avatar
0 votes
0 answers
28 views

Can't identify problem in pset4 after check50

https://sandbox.cs50.net/checks/047d3f8abf62487eb8fe86f9ebd6492a Can anyone please tell what the errors maybe?
Chetan Munegowda's user avatar
0 votes
0 answers
143 views

pset4/resize | reading and writing a file simultaneously?

I'm trying to use "malloc" approach to the task. My algorithm is: draw a multiplied scanline into a new file fread this line, save itto a string, write it to the file factor-1 times do the same ...
Fed's user avatar
  • 3
0 votes
1 answer
196 views

Pset 4 resize - Help with fseek using current position

I just need a hint to point me in the right direction.. I can't think of a formula to make fseek go to the next line. If I leave it as it is I think it will just keep rewriting the same line in the ...
Ryan McCauley's user avatar
0 votes
1 answer
52 views

Strange error with PSet4 resize.. please help!

I tried to use an array to store the original pixels, and then reprint them 'n' times in the fprint function.. I don't know where it's wrong, everything else looks good to me, the headers match the '...
Alec Lindsay's user avatar
0 votes
1 answer
78 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 ...
uddane's user avatar
  • 3
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
0 votes
1 answer
41 views

Resize acting weird in some cases storing 1 pixelXpixel less

I have spent lots of time reading to find someone with alike problem, but simply couldn't. Would be so much thankful for any hint! My resize is acting weird, despite the varriables store correct ...
Valeriya's user avatar
0 votes
0 answers
44 views

What is the for-loop in resize.c doing?

Can someone can explain, like you would to a little child (I'm an adult), what the for-loop is doing in resize.c? Also, what a "scanline" is and what "abs" does in the code they have provdided.
sisball8's user avatar
0 votes
1 answer
313 views

PSet4 image invalid

Here is my code. It seemed to be working but apparantly my image is undefined. I know that I have to catch the if condition at the beginning but can anyone tell me why my image was undefine /** * ...
Hai-Dang Dam's user avatar
0 votes
0 answers
266 views

Problems with my header info in resize

I am working on resize, pset 4, for some time now and believe I am making a mistake in my header info. When I resize to 1 everything is going fine but when I resize to 2 I get the following text: ...
Kiwi's user avatar
  • 179
0 votes
1 answer
174 views

resize seems to work fine, but check50 doesn't agree!

Can I get some help please with the pset4's resize? My code SEEMS to work just fine, as in it compiles and runs with no problems (even with different n factors), and when I use (xxd ...) to show the ...
Askar's user avatar
  • 7
0 votes
1 answer
118 views

without changing the size the image is resized how ?

I haven't re-sized the new bitmap file but still i get an output which is same as large.bmp. I dont know how this work even if I haven't changed the size of image or the file
Sumit Bawri's user avatar
0 votes
1 answer
104 views

My resize.c shows twisted outfile image

I've been struggling with resize coding for more than three weeks. Still cannot get the correct outfile. Instead it shows 'twisted image' as shown below (image viewer zoom fit). There must be ...
Yoshi Watt's user avatar
0 votes
0 answers
704 views

Problem with header data, biSizeImage and bfSize have values of small.bmp

So my code is working fine - images resize exactly as they should (as far as my eye can tell) for images both with and without padding, but my header data is wrong when I compare to staff.bmp. My ...
GCOTT94's user avatar
0 votes
1 answer
203 views

pset4 resize.c doesn't work if n > 1

my resize code doesn't work if n is greater than 1 and i don't understand why, if i printf the values they are right but peek values are wrong. My code is: //resize the image // Get n int n = atoi(...
Alex Puente's user avatar
0 votes
0 answers
743 views

Why does my blown up file in resize.c have bogus header data?

Please help resolve this issue.. Thank you so much!! /** * copy.c * * Computer Science 50 * Problem Set 4 * * Copies a BMP piece by piece, just because. */ #include <stdio.h> ...
FOTIOS EMERY's user avatar
0 votes
1 answer
110 views

Pset4 resize.c outputting giant block of pixels

Firstly I apologize because there are many posts asking similar questions, but I've read over all that I could find, and it appears to me that my logic should be correct. This leads me to believe ...
Andy Nonomous's user avatar
0 votes
1 answer
153 views

pset4 resize.c enlarge code doesnt work

I cant seem to get my enlarge code to work. I am trying to make it go back and do the pixel n number of times but my code is faulty but I cant figure out why. I have only included my padding and ...
Muneeb Hussain's user avatar
0 votes
1 answer
118 views

Check50 passes in some instanses, despite images and headers identical to staff's?

I compared my headers to the staff's, and they were the same, as well as use the "diff" command and they were the indeed the same. I have read other forums on this site, and I believe the problem lies ...
Dylan Savoury's user avatar
0 votes
1 answer
105 views

Despite having identical Headers to the staff's, image is comes out incorrectly?

// declare updated headers BITMAPFILEHEADER NewBf = bf; BITMAPINFOHEADER NewBi = bi; // update BITMAPINFOHEADER NewBi.biWidth = bi.biWidth * n; NewBi.biHeight = bi.biHeight * n; // determine ...
Dylan Savoury's user avatar
0 votes
2 answers
2k views

Why is my array of RGBTriple not working?

I know there are a lot of questions surrounding this topic. Read 'em, still having trouble. The common suggestion here for declaring an array of RGBTriples is something like the following: ...
Brian Poindexter's user avatar
0 votes
1 answer
374 views

check50 error on resize.c pset4

My program for resize.c is able to resize the bmp's provided with the pset4, for example small.bmp, smiley.bmp but after running the command check50 2014.fall.pset4.resize bmp.h resize.c on terminal ...
vhatharvard's user avatar
0 votes
0 answers
321 views

PSET4 Resize Works for Smiley but not Small

Hi I can get Resize to work fine for Smiley for all sizes, but I can't get ANY sizes to work for Small. Please help! I think the problem has to do with the padding, but not sure why it would work ...
FEA's user avatar
  • 1
0 votes
0 answers
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 ...
Lulu Machete's user avatar
0 votes
1 answer
264 views

pset 4 resize Image correct but size is off

Hello I am working on pset4 the resize part. My images look correct but they are a few bytes larger than the staffs is. I use peek to check the headers and they match the staffs exactly. The larger ...
arortell's user avatar
0 votes
2 answers
620 views

resize compiles but still can't go through cs50 check

I have been in resize for a month....Finally the program runs but when check50, still all :( except resize by 1, below is my code // determine padding for scanlines int padding = (4 - (bi.biWidth * ...
Hang Man's user avatar
0 votes
0 answers
2k 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 ...
Hang Man's user avatar
0 votes
0 answers
99 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 ...
user avatar
0 votes
1 answer
664 views

Not sure why resize.c isn't working

resize.c compiles and runs, but produces an image with a lot of black space. A fresh set of eyes on my code is welcome to see where I have gone wrong. I assume it has to do with padding but I can't ...
Kim's user avatar
  • 137
0 votes
0 answers
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 ...
yash bansal's user avatar
0 votes
0 answers
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 &...
Amrita's user avatar
  • 50
0 votes
1 answer
556 views

Rewrite method in resize.c

I am currently trying to conceptualize the idea of creating the vertical nth copy for resize.c but I don't grasp how the file position indicator can tell when there is a new line. How do I tell C to ...
gedm's user avatar
  • 1
0 votes
0 answers
183 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 ...
Mike Stache's user avatar
0 votes
1 answer
397 views

How does the "re-copy method" work?

So, in Zamyla's walkthrough, she says that for the "Re-Copy" method of vertical resizing, you have to go back to the start of the original row, and then repeat the horizontal resizing. I don't ...
a7464270's user avatar
0 votes
1 answer
42 views

Pset3 Resize - image has more bytes than expected

I have a problem with this pset3-resize-less. Everything works fine but when I run check50, only first three things are correct: :) resize.c and bmp.h exist. :) resize.c compiles. :) doesn't resize ...
Vladimír Ondrášek's user avatar