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

PSET4 resize (less) check50 error

This code works as expected visually, however when going through check50, it returns an error (resizing with a factor of 2 for example) "Header field bfSize doesn't match. Expected 0xae, not 0x126" ...
0
votes
1answer
62 views

pset4 ./resize .2 (.4)

I'm done with resize [more]. And check50 was ok. But when i check my program for not 0.25/0.5 size, but for size 0.2/0.4 the image was fail ./resize .2 large.bmp student.bmp .1 - OK .15 - OK .2 - ...
0
votes
1answer
61 views

PSET4. Resize, less comfortable. Something is wrong in my code

I am on pset4 and working on resize, less comfortable. I chose to follow the "rewrite" method but it seems that I am going wrong somewhere and I have no idea what to do. Any advice or help is most ...
0
votes
1answer
116 views

PSET4. Resize, less comfortable. "Rewrite" method not working for me

I am on pset4 and working on resize, less comfortable. I chose to follow the "rewrite" method but it seems that I am going wrong somewhere and I have no idea what to do. Any advice? // determine ...
0
votes
1answer
50 views

Pset 4 - resize. Problem with proper padding

I've been stuck on resize for a while and I think I nearly have it. My outputs are nearly accurate except for the fact that some of the pixels are not being placed properly, and I think this has ...
0
votes
1answer
29 views

Pset 4...image resizes only smiley

Now the simley image gets resized properly....but the small.bmp does not...i checked the header information via specification...but both turn out be correct....here is the code.. #include <stdio.h&...
0
votes
1answer
53 views

Image does not resize properly, with recopy method. PSET 4 Resize

So I have been stuck for 1 week, i am not getting it, can somebody give me a hint so to what I am doing wrong, I am trying to do it via recopy method. originalHeight = labs(originalHeight); //Recopy ...
0
votes
1answer
73 views

Resize.c (less) writing excess padding

I'm on Pset4's Resize (less comfortable), using the recopy method. When I plug in small.bmp and resize it with a scale factor of 2, I get a black block in the middle. With any higher scale factors, it ...
0
votes
1answer
522 views

pset4 resize working perfectly but can't pass check50

I am in the 4th problem set in cs50 trying to do resize.c. I worked on it for about 3 days and finally everything is going great the program can resize whatever bitmap photo I throw at it. I was ...
0
votes
1answer
91 views

Pset4, resize (more comfortable) random image generated and I don't know why

Whenever I use resize, it will always generate something completely different from its input image. I think it has something to do with the part of my code I pasted below, but other than that I am ...
0
votes
0answers
95 views

pset 4 Resize - expand vertically

/** * Copies a BMP piece by piece, and increase by factor of n */ include include include "bmp.h" int main(int argc, char *argv[]) { // ensure proper usage if (argc != 4) { ...
0
votes
1answer
55 views

fread seems to break my program

I've been spending a lot of time trying to get my head around the fread and fwrite functions. In said (vain) attempts, I made some little changes to the copy.c program that is provided as part of ...
0
votes
1answer
115 views

Pset 4 Resize less **Spoiler ** still stuck

Had to walk away from this but looking over it again and hitting a wall. Can someone take a look ?? #include <stdlib.h> #include <stdio.h> #include "bmp.h" int main (int argc, char *argv[...
0
votes
1answer
36 views

Spoiler Pset 4 Resize less, 2nd go around

I have worked on this so many hours. Thought I had fixed things up but still not resizing correctly. Can someone check my code and let me know where I am messing up ?? #include <stdlib.h> #...
0
votes
1answer
332 views

Need help in Pset4 resize less. Compiles but biSize headers not sizing correctly

[solution code removed] ) resize.c and bmp.h exist. :) resize.c compiles. :( doesn't resize small.bmp when n is 1 Header field bfSize doesn't match. Expected 0x5a, not 0x48 :( resizes small.bmp ...
0
votes
2answers
117 views

Pset4 (less) - vertical resizing

I have resized horizontally successfully but am having trouble with vertical resizing. I have done a header check against the staff headers and they are the same so I don't think the problem is there. ...
8
votes
1answer
2k views

Hacker4/Resize: can't resize when factor is a decimal number

Everything went good so far until this pset and the resize exercise, it seems that I'm stuck and need help! Everything works perfectly when the factor is a whole number (eg. 2). In my code, the ...
0
votes
1answer
32 views

Resize infile won't read from argv

When I try to assign char *infile to argv[2] all that I infile ends up being is "". In that first for loop it prints fine but it won't work with the infile. The outfile also doesn't have any problems ...
0
votes
1answer
841 views

resize malloc bug and issue with file output

I have a number of issue but the most disatarous is my malloc ./resize': corrupted size vs. prev_size: 0x0000000001903480 *** when calling the function currently. The problem there (besides sucking at ...
0
votes
2answers
56 views

Pset4 Resize: Invalid Format

Every time I try to resize a picture I get an error saying "Invalid or Unsupported Image Format" and I'm not sure what I've mistyped in my code. I've looked at it, I've googled, and a week ago I even ...
1
vote
1answer
115 views

Resize Invalid Image Format

For the past couple of days, I have been struggling with Resize (less comfortable). I have looked at similar questions and I've been able to fix some problems yet my largest one remains the same: my ...
0
votes
1answer
281 views

Understanding padding and fseek()

I have a simple doubt that, can padding be put for all of the scan-lines at once? What I mean to say is, that suppose, I have bi.biHeight == 10 then if I Write for (int k = 0; k < padding; ...
0
votes
1answer
262 views

Incompatible pointer types error when fwriting to RGBTRIPLE array

I am attempting to implement the "rewrite" method of vertical scaling in pset 4's resize problem. I declare an array of RBTTRIPLE's in which I want to construct the outfile scanlines. When I try to ...
0
votes
1answer
75 views

For resize I don't know what is wrong with the code.. Why is fseek needed?

#include <stdio.h> #include <stdlib.h> #include <cs50.h> #include "bmp.h" int main(int argc, char *argv[]) { // ensure proper usage if (argc != 4) { fprintf(...
0
votes
1answer
51 views

pset4 resize: no problem with debug50 but file becomes corrupt

Here is my code. Debug50 runs without any wrong value but when i open the file AFTER using debug50, it shows to be of 0 bytes and doesn't open. on compiling with ./resize, some of the bytes get ...
0
votes
1answer
370 views

Where do I place bi.sizeImage and bf.bfsize? Are bf.bfsize and are bi.sizeImage correct?

In resize less comfortable I need help with bi.sizeImage and bf.bfsize write outfile's BITMAPFILEHEADER // I Tried placing new_new_bfsize here fwrite(&bf, sizeof(BITMAPFILEHEADER), 1, outptr)...
0
votes
1answer
96 views

In resize less comfortable I need help with bi.sizeImage and bf.bfsize

I have been busy for a while. I modified the code but it still doesn't work. I am not sure where to put the new headerfiles. > > write outfile's BITMAPFILEHEADER // I Tried ...
0
votes
1answer
77 views

Resize less confortable : issue writing new file header info and printing new image

I have been struggling for a couple of days on the resize less confortable problem. So far my resized image looked enlarged by the right coefficient but the white section remains too small compared ...
0
votes
1answer
224 views

Resize(less comfortable)

I think I'm close but I'm still getting the wrong image each time I try to resize small.bmp to large.bmp. I know it's somewhere in the loops at the end of the code but I'm just not seeing it for some ...
0
votes
1answer
103 views

pset 4 resize (less)

Having some growing pains with this pset. I think I have the horizontal resizing figured out with my for loop. My problem is iterating over the same line x number of times (where x is the scale ...
0
votes
1answer
272 views

fread() and fwrite() problem

I've been working on resize.c and after a long time of hard work. I completed it but I wasn't able to understand that Whenever I use fwrite(&triple, sizeof(RGBTriple), atoiargv[1], outptr); ...
0
votes
1answer
33 views

resize.c says file is unsupported

Please help me find out the bug in my code my resize.c does not print any error but after execution results into a file which is unsupported /** * Copies a BMP piece by piece, just because. */ #...
0
votes
1answer
145 views

Pset4 resize less comfortable, problems with fseek

I'm struggling a bit with resize. I think my headers work correctly as I do get a correct size output, but after the first horizontal line everything goes wack. My guess is that the fault lies in how ...
0
votes
1answer
497 views

CS50 resize.c pset4(2017) pset3(2018)

Good afternoon and a happy New year to you all. I am currently having issues with resize.c My resized file is made but will not open in the CS50 IDE. I get an error saying that it is an unsupported ...
0
votes
1answer
81 views

PSET4-RESIZE | Weird bmp output while resizing

I'm currently trying to figure out what am I doing wrong while resizing the pixels, the weird location of the pixels suggests me that something is wrong with the padding, but I'm not sure. And it ...
0
votes
2answers
881 views

Resize - Which function to use to write in a RGBTRIPLE buffer?

I am having some trouble in the following code : void bufferwrite(RGBTRIPLE rgb, RGBTRIPLE* buffer, int n, int padding) { fwrite(&rgb, sizeof(RGBTRIPLE), n, buffer); for(int i = 0; i <...
0
votes
1answer
242 views

Pset 4-- Resize

I've gone through my code, and I've progressed now to the point that the outfile finally scaled correctly, but now the colors are off for some reason, and I have no idea why (Infile and Outfile BMPs ...
0
votes
1answer
153 views

PSET 4 (Resize)-- Vertical Scaling

I'm having trouble with the vertical scaling. I've reviewed my code and it seems like it should scale correctly, but instead I get the following picture. My pseudocode for vertically scaling goes as ...
0
votes
1answer
27 views

Disalignment in the resized photos

I've been stuck on Resize for quite a while now, and I've been perusing the other questions on this site but can't find my problem answered. When I resize the .bmp files given by the class, I can do ...
0
votes
1answer
240 views

Help with vertical resize in pset4's resize.c

I know this question's a repeat, but all the other questions had code and I didn't want to look through that as it felt like cheating. The way I understand how to resize vertically is to fwrite the ...
0
votes
1answer
160 views

Pset4 Resize (less) vertically re-copy not working - no idea why, help badly needed

/** * Copies a BMP piece by piece, just because. */ include include include "bmp.h" int main(int argc, char *argv[]) { // ensure proper usage if (argc != 4) { fprintf(...
0
votes
1answer
78 views

CS50 Pset4 Resize - Vertical Sizing

I have no problems with the horizontal resizing but can't identify what is the problem in my code with the vertical resizing. Any help would be much appreciated. /** * Copies a BMP piece by piece, ...
0
votes
1answer
94 views

Stuck on resize pset4 using recopy method

My program works fine visually but fails in check50.newpadding is outfile's padding and oldpadding is infile's padding. for (int i = 0, biHeight = abs(oldHeight); i < biHeight; i++) { // temporary ...
0
votes
0answers
74 views

Is resize.c/more functionality for n < 1 subjective?

I am having issues with getting my outfiles for n = 0.5 to match check50's. To scale a bitmap image down pixels must be removed, and the algorithm we're required to write is what will choose which ...
0
votes
2answers
103 views

pset4 resize less issue

Can anyone help me with my code, please? I get this result, and don't know how to fix this: My code resizes images horizontally, but does not do the right thing with height: // remember filenames ...
0
votes
1answer
165 views

Pset 4: Resize (Less) Hint needed

Please could somebody give me a hint on my code for the Pset4 resize less comfortable. It seems to resize the image horizontally but Im having trouble making the vertical resizing. Im getting garbled ...
0
votes
1answer
50 views

Resize PSet4 - Issues with padding

I've looked at a lot of responses to question relating to these PSET. My approach to this was a bit different than some of the other posters. I create an array of values with all the necessary ...
0
votes
1answer
78 views

pset4, resize. Why does my change of headers create images that say invalid/unsupported image format?

I have looked through many of the same questions but come up with no answers. I am solely focusing at the moment on changing the headers and have tried to get calculations correct but something must ...
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 ...

1
3 4
5
6 7
13