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

102 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
53 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
0
votes
1answer
81 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 ...
0
votes
0answers
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
0
votes
1answer
127 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 ...
0
votes
2answers
549 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 ...
0
votes
1answer
58 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 ...
0
votes
1answer
301 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 ...
0
votes
1answer
24 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 ...
0
votes
1answer
53 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/...
0
votes
0answers
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 ...
0
votes
1answer
76 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 ...
0
votes
2answers
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 ...
0
votes
1answer
155 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 ...
0
votes
0answers
28 views

Can't identify problem in pset4 after check50

https://sandbox.cs50.net/checks/047d3f8abf62487eb8fe86f9ebd6492a Can anyone please tell what the errors maybe?
0
votes
0answers
141 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 ...
0
votes
1answer
193 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 ...
0
votes
1answer
49 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 '...
0
votes
1answer
75 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 ...
0
votes
1answer
117 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 ...
0
votes
1answer
37 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 ...
0
votes
0answers
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.
0
votes
1answer
308 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 /** * ...
0
votes
0answers
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: ...
0
votes
1answer
169 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 ...
0
votes
1answer
117 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
0
votes
1answer
97 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 ...
0
votes
0answers
676 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 ...
0
votes
1answer
202 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(...
0
votes
0answers
682 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> ...
0
votes
1answer
109 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 ...
0
votes
1answer
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 ...
0
votes
1answer
111 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 ...
0
votes
1answer
99 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 ...
0
votes
2answers
1k 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: ...
0
votes
1answer
368 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 ...
0
votes
0answers
317 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 ...
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
262 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 ...
0
votes
2answers
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 * ...
0
votes
0answers
771 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
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 ...
0
votes
1answer
663 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 ...
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
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 &...
0
votes
1answer
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 ...
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
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 ...
0
votes
1answer
40 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 ...
0
votes
1answer
92 views

pset 4 resize please help

//CREATE A PROGRAM TO RESIZE A BITMAP FILE //include C libraries #include <stdio.h> #include <stdlib.h> #include <math.h> #include "bmp.h" int main(int argc, char* argv[]) { //...
0
votes
1answer
193 views

Week 4. Resize - Less Comfortable

I hit a wall a while ago on 'more comfortable' and since downgrading have been trying attempts on this for a few days - fully aware i'll be missing something, either in my logic or implementation but ...