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

cs50 pset3 resize less

im having some problme with resize and cant find them.. would love some help, ty! // Copies a BMP file #include <stdio.h> #include <stdlib.h> #include "bmp.h" int main(int argc, char *...
0
votes
1answer
53 views

Resize pset4 - Can someone check my code

Please someone help me with my code. I think that problem is the fseek function. I don't know how to calculate the number of bytes needed to be skipped. I obtained wierd images with distorted collors. ...
0
votes
1answer
86 views

PSET3 resize vertically help

I'm struggled for 12 hours on resize problem. After trying for so long i reach to this result. The smiley BMP file looks well but it doesn't seem to be fully resized. When i try to resize small.bmp ...
0
votes
1answer
122 views

PSET3 Resize (more comfortable) do not understand why code is not working

I posted my code a few weeks ago, and I have been working on it for a some hours today but I am really stuck as to why it is not working. I have not yet written the code for resizing down. It would be ...
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
381 views

Vertical Scaling with Array Method

I'm having some trouble with the logic of vertically rescaling. I stored my horizontal line in an array and tried to copy it by n(factor) times all within the 'j' for-loop. This doesn't seem right. ...
0
votes
1answer
38 views

pset3 Resize: Header values not copying into outfile

My output.bmp file yields "Invalid or Unsupported Image Format", and using ~cs50/2019/x/pset3/peek output.bmp yields "Could not recognize output.bmp". Using check50 also gives the error "Header field ...
0
votes
2answers
71 views

Problem with CS50 Pset3 Resize Less

The issue that keeps occurring after compiling and running the file, is that the resulting output bmp file changes to an unsupported file format(as stated when clicking on the bmp image file after ...
0
votes
1answer
79 views

PSET3 Resize (more comfortable), resizing f > 1 correctly, but pixels are different colors. Does not work when f < 1

**Relevant code is after comment: // iterate over infile's scanlines This code is able to make a new larger bmp with the correct dimensions, but the pixels are not the same color as the original bmp. ...
0
votes
1answer
46 views

PSet4 / Resize / Less: When to put the pointer back to the beginning?

I'm struggling with when to put the pointer back to the beginning. Every time I want to copy the same scanline vertically, I know I need to move the pointer on the input file from the end of the ...
0
votes
1answer
207 views

Invalid or Unsupported format - pset4 (resize)

I'm pretty sure I've done everything right, at least to my eyes. But my resize program compiles alright and creates the large.bmp alright. But when I try opening it it says invalid or unsupported ...
0
votes
1answer
20 views

Taking scale factor input in Resize--pset3

I'm trying to take an input integer between 1 and 100 and store its value as n, which I will then refer to as the scale factor, and use it later on in the redefinition of bi.biWidth *= n; and in ...
0
votes
1answer
51 views

CS50 - Pset3 - Resize (Less) - Wrong Bitmap Size

Could someone please review my code for Resize (Less) pset? My code resized everything correctly before I added a couple of extra variables and changed some things up, so I had some base sizes that ...
0
votes
1answer
40 views

resize pset3 i'm having a problem with the downsizing

so my program is working correctly the only problem is with the downsizing i can't make it work correctly here is my code #include <stdio.h> #include <stdlib.h> #include <stdlib.h> #...
0
votes
1answer
24 views

Resize less confortable pset3. Result seems ok if open as hexadecimal but the print result is cropped

After a long struggle with this one I finally got close to completing it. When I open the enlarged file, the lower rows are missing. However I can see these seem to be ok when I open the file as ...
0
votes
1answer
46 views

resize : pset3 not all colors are appering after resizing

so im trying to resize an image of green square that has a smaller white square inside it and when i do the resizing the green square resize but the white one disappears i'dont know where the problem ...
0
votes
1answer
60 views

PSET3 - Resize (Less) : Random colours being printed?

Going through the walkthrough of 'Resize (less)' and currently trying to resize horizontally. When running resize, only a few pixels have the correct colour and others have completely random colours. ...
0
votes
1answer
63 views

I can't figure out the problem in my resize (more) code

I was actually able to solve resize (more), but I'm not able to figure out what's wrong with one of my previous codes (the one I was stuck for longest on) This is my old code: #include <stdio.h&...
0
votes
1answer
65 views

PSET3: Resize (more comfortable) - What am I doing wrong?

This code outputs a seemingly random assortment of colors after the initial scanline, which is correct. If I comment out the for loop that fwrites the scanline "n"(the multiplier) times for every row, ...
0
votes
1answer
38 views

pset4 resize: setting bfSize and biSizeImage hexadecimal values

I'm having difficulty setting the bfSize and biSizeImage header values. I should have the correct formulas for both values, however when I write either value to the output file I lose the leftmost ...
0
votes
1answer
33 views

CS50 pset3 i want to resize this image, code is working for some and not for others? Can anyone tell me whats the problem?

int n = atoi(argv[1]); // read infile's BITMAPFILEHEADER BITMAPFILEHEADER bf,bfR; fread(&bf, sizeof(BITMAPFILEHEADER), 1, inptr); bfR = bf; // read infile's BITMAPINFOHEADER BITMAPINFOHEADER bi,...
0
votes
1answer
77 views

pset3 Resize - Invalid or unsupported Image Format

So i think i finished resizing horizontally but when i try to open the output image to check i get an error saying "Invalid or unsupported Image Format", I read other similar questions here and i ...
0
votes
1answer
48 views

Need help finding bug in resize

I have been staring at this code for hours now and can't find what is wrong with it. It makes a new bmp image that is "n" times larger, but there is something wrong with the reading frame because the ...
0
votes
1answer
89 views

Where am I going wrong with this resize?

My output is a grey square with a white rectangle at the top and bottom. What is it fwriting? // iterate over infile's scanlines (for each row) for (int i = 0; i < bi.biHeight; i++) { //...
0
votes
0answers
107 views

PSET3 Resize -resizes correctly Byte... doesn't match

I don't understand what I did wrong... Here's my code : // Copies a BMP file #include <stdio.h> #include <stdlib.h> #include "bmp.h" int main(int argc, char *argv[]) { int n = ...
1
vote
2answers
130 views

Yet again, problem with padding

I am having a problem with my code, and I think it has to do with the use of fseek. I have read a lot of the articles on the cs50 Stack Exchange, and tweaked my code a lot, but my problem still ...
1
vote
1answer
52 views

Resize PSET4 Invalid or Unsupported Image Format

So here is my code, I think I'm going wrong because the BITMAPFILEHEADER and BITMAPINFOHEADER are not being updated, so there are too many bytes being written to the output file, am I right with this? ...
0
votes
1answer
102 views

Resize less comfortable (recopy method) need help

I implemented resize using recopy method as bellow but I think there are still some mistakes in my code that why it didn't yield the correct result. The thing is I'm not really sure how to implement "...
0
votes
1answer
46 views

resize not correct for all n

Does anybody have any idea what I might be doing wrong in my code for resize? I think the logic of the implementation to be correct, the problem should be somewhere in the syntax... Something that ...
0
votes
1answer
60 views

Resize(less comfortable) recopy method

I'm working on resize at the moment. I watched walkthrough and followed the instruction until resize horizontally. I tried to compile it and without any errors. Then, I executed "./resize 1 small.bmp ...
0
votes
1answer
115 views

Rewrite method in Resize (less) is printing wrong large.bmp

So my small image is resizing vertically but I get all the wrong colors. Can someone take a quick peek at my rewrite method to see where I've gone wrong? I've attached a pic of my large.bmp passing in ...
0
votes
1answer
160 views

CS50 - Pset3 - Resize (Less)

Can someone please review this code for Resize Less pset. It seems to me that it is functioning correctly and resizing the images appropriately. However, I am failing all of the checks when is submit ...
0
votes
1answer
39 views

Pset 3 Resize(less) - How to find the padding for the small image?

In this pset we have to keep track of both the small image and large image paddings. I understand how to calculate the padding for the large image but for the original small.bmp do I use the formula: ...
0
votes
1answer
285 views

Not able to get the correct enlarged image in resize

It is able to resize horizontally and vertically but i am not getting the correct enlarged image. include include include "bmp.h" int main(int argc, char* argv[]) { // ensure proper usage ...
0
votes
1answer
192 views

Resize(less) How to store triple into an array?

I have been struggling with resize (less). I can't seem to make sense of how to put the value of triple that is being read into an array (rewrite method) Any help will be appreciated // iterate over ...
0
votes
1answer
83 views

PSET3: Resize vertical fseek issue?

So I have looked through every response to this and I still for the life of me can't figure out what I am doing wrong here. The output is repeating each line twice all the way down. I have tried ...
0
votes
1answer
73 views

cs50-PSET4-Resize-Simply stuck on vertical resizing

I have it upto here and now it does resize, but the image is off. Having a hard time trying to figure out where its going wrong since debugger etc doesnt reveal much info on files and arrays. https:/...
0
votes
1answer
89 views

Pset 3 - Resize - Resizing problem

I'm currently working on resize, and for some reason the pixels in each row (except for one, the middle white one) seem to get resized horizontally except that with the resized pixel its a different ...
0
votes
2answers
63 views

Pset 3 - Resize - header problem

I'm currently working on resize, and I attempted to solve the part about updating the outfile's header info, but I think I messed up somehow. The bi2.biWidth and bi2.biHeight (see my code) get set to ...
0
votes
2answers
126 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
1answer
236 views

Resize (more comfortable)

code doesn't pass last 3 check50 test(when f is 0.5) :) 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 :) ...
0
votes
1answer
75 views

Why isn't resize(more) printing properly?

I am back again with another question about resize more. I feel like I am pretty close, but for some reason it is not resizing vertically properly when the factor is larger than 0 (I haven't dabbled ...
0
votes
1answer
86 views

pset3 resize(less) working correctly, but check50 show a bunch of "image has more bytes than expected

I'm not sure where I went wrong that is causing it to add too many bytes. When I test the program, it seems to resize everything correctly. Code: #include <stdio.h> #include <stdlib.h> ...
0
votes
1answer
60 views

Random Black Pixels on Resize More

I am currently working on Pset3 Resize More. This is something I have never really done before, and I am really not sure if I am missing something major or not. Right now, I know that I can't shrink ...
0
votes
1answer
27 views

pset3/resize same expexted sizes for different scales

While resolving resize(less) problem I've encountered check50 expects the same sizes of files with different scales. How could that be? :( doesn't resize small.bmp when n is 1 Header field biSize ...
1
vote
1answer
129 views

Pset3 - Resize (less confortable)

I am getting an error at IDE "Invalid or unsupported file format" for an input "n" equal or greater than: 68 for small.bmp 36 for smiley.bmp 27 for large.bmp I also tried to peek with staff's ...
0
votes
1answer
379 views

Pset 3 Resize (Less) : Still stuck, likely problem with changing bitmap size

Been stuck on Pset3 Resize (Less) for days... I think i got my headers right, but i am unable to resize the image size properly. When i try to resize small.bmp, it goes from this: to this: Will ...
0
votes
1answer
62 views

CS50 Pset4 Resize Padding. again

CS50 Pset4 Resize Padding. again I need help! I got lost The code creates a scalable bmp file but is distorted. I think there is a mistake with padding int main(int argc, char* argv[]) { // ...
0
votes
1answer
403 views

Resize (more comfortable) - Code does not pass last 3 check50 test (shrinking by 0.5)

For the 2019 version of Resize (more comfortable), my code is able to pass all but the final three tests: :( resizes 6x6-pixel BMP to 3x3 correctly when f is 0.5 expected exit code 0, not 1 :( ...
0
votes
1answer
106 views

pset3/resize - segmentation fault

I'm getting a segmentation fault and tbh have no idea why. I run valgrind and it all seems good, no memory leak. If I run debug50 the code just switches off halfway through execution on line 43 giving ...

1 2
3
4 5
13