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
68 views

Pset 4 resize: Image remains same size and image changes

I have an issue that I have been tearing my hair out for a week about. My code does not resize the image and it doesn't keep the image the same. What is the problem with my logic? /** * Copies a BMP ...
1
vote
2answers
37 views

Resize less fails when trying to resize small.bmp when n is not multiple of 4 or is 1(probably padding issue)

int oldHeight = bi.biHeight; int oldWidth = bi.biWidth; bi.biWidth *= n; bi.biHeight *= n; int padding = (4 - (bi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4; bi.biSizeImage = ((sizeof(RGBTRIPLE) * bi....
0
votes
1answer
118 views

bfSize different colors resize pset4

I just cannot stop getting funky different colors when I resize, and I see it must be some padding issue. I used the specs and peek to compare my file student.bmp with the staff.bmp. It shows in red ...
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
1answer
28 views

PSET 3: Resize (less) malloc?

I've been stuck on this problem for weeks now and I've made headway. Copy/pasting has lead me to a doubling the dimensions of the image but not actually printing the image at twice it's size. I ...
0
votes
1answer
323 views

resize runtime error pset4

My code compiles, but when I execute this I get: runtime error: index 4 out of bounds for type 'RGBTRIPLE [newbi.biWidth]' Where does 4 come from? Is it the number of arguments?? Thanks for any help....
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
1answer
73 views

Pset4. Resize, less comfortable. Don't understand why code is working

I was having issues with my headers because I chose to create a separate header file for my new header changes. However, my code was not passing the check50. Upon researching and questioning, I found ...
0
votes
1answer
31 views

PSet3 Resize (Less) = Random Colors when not 1:1

I saw others posted about the same phenomena I am experiencing, but none of their solutions were what I needed. n = 1 works perfectly. This is large.bmp with an n = 2. I realize the first line of my ...
0
votes
2answers
55 views

Wierd out put with resizing small.bmp to 3X3

What could I have been doing wrong? The code works is I resize small to 4X4.It even clears 5 out of * tests. Please help.
0
votes
1answer
158 views

pset4: resize (less comfortable)

I am receiving the below when I check Pset4: :) resize.c and bmp.h exist. :) resize.c compiles. :) doesn't resize small.bmp when n is 1 :( resizes small.bmp correctly when n is 2 Byte 22 of pixel ...
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
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
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
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
93 views

pset4 resize problem

I have written a code to resize an image but the output image is not matching the input. The image is scaled fine but its content changes. Can somebody look at my code and tell me what is wrong? ...
0
votes
1answer
54 views

Resize doesnt compile and check 50 can't check my program

My program seems to resize correctly but when i compare headers it seems that there's a bug, i use check 50 and it says that resize.c doesnt compile and the rest of tests give me a yellow poker face ...
0
votes
1answer
77 views

Pset4 resize (less) Invalid file format

This pset has been super hard for me. I am trying to resize horizontally before I tackle vertical and I am able to compile and run the program but when I go to open the output file I get the error ...
0
votes
1answer
56 views

I have no idea how to implement padding or vertical rows

I've been stuck on this problem for days now, my problems arrise from the following: 1- I have no idea how to implement padding 2- I have no idea where the vertical loop would go 3- I have no idea ...
0
votes
1answer
540 views

pset4 - resize: Scaling vertically?

I have the dimensions of the image right, and I have the horizontal scaling working, but I can't figure out how to get the vertical pixels to scale correctly. I've watched the walkthrough repeatedly, ...
0
votes
1answer
101 views

Invalid or Unsupported Image Format

When I run my code and try to open the image that it created, I receive the following error: "Invalid or unsupported image format." Can someone please help me understand why this is happening? I ...
0
votes
1answer
1k views

PSET4: Resize(more comfortable) problem in downsizing

So, I have completed less comfortable version of resize and moved to more comfortable version. I came up with an idea of averaging when we downsize. i.e, if initially pixels were 16x16 and n = 0.5, ...
0
votes
1answer
214 views

Resize : please, i'm struggling to finish resize. There is something that I don't understand to pass check50

Please, help me to understand where should i focus because I spent so many hours on this..... i would love to finish it :) here message from check50 : :) resize.c and bmp.h exist. :) resize.c ...
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 ...
1
vote
1answer
542 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
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
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
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
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
1answer
127 views

Pset4 Resize (less) help

I'm stuck on resize. I feel like i'm doing everything right but have no idea why my code isn't working right. I think i'm pretty close but the vertical scaling isn't working as it should it seems. ...
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
85 views

pset 4 resize.c algorithm problem

I can't figure out why my code wont work. Please help. My idea for solving the height problem was write one line of the image move the file cursor to the beginning of the newly written line read in ...
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
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
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
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
1answer
62 views

Pset 3 - Resize - Resizing problem 2

I'm currently working on Resize, and it just doesn't work as it should (see picture (scale value used was 2). Any suggestions? Here's my code: https://gist.github.com/AProgrammerZ/...
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
78 views

Pset4, square is completely green

So now my square is completely green, but I believe it ressizes correctly. my code is as follows: #include <stdio.h> #include <stdlib.h> #include "bmp.h" int main(int argc, char *argv[...
0
votes
1answer
97 views

pset 4 resize Invalid or Unsupported Image Format

I keep getting an error from the IDE saying "Invalid or Unsupported Image Format" and I haven't been able to figure out why. I have looked at other questions but none seem to help. bi_new.biWidth = ...
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
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
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
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
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
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 ...
1
vote
1answer
510 views

adding padding into resize

I know my paddingOld & paddingNew values are correct. I also know all my header info is correct (checked student vs staff) check 50 passes the cases that do not need padding, but fails the ones ...
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 * ...
1
vote
3answers
423 views

pset5 resize working (IMO) but check50 says it's not

I'm having a bit of an issue here.. I wrote the resize.c function for pset5 and it is working - I am getting the expected results - I can see my file being resized and it looks alright in image ...
0
votes
1answer
136 views

Resize horizontal scaling

I am really racking my brain over this. I'm trying to implement horizontal scaling for resize but all I'm getting are grey and white boxes. int main(int argc, char *argv[]) { // ensure proper usage ...

1
2 3 4 5
13