Skip to main content

Questions tagged [resize-less]

Filter by
Sorted by
Tagged with
0 votes
2 answers
40 views

Code divides image

I run my code and it complies and provides a (kind of) reflected image. It breaks the image in half and mirrors it instead of just reflecting. My goal was to switch the place of each pixel in the row, ...
michael's user avatar
  • 11
0 votes
1 answer
25 views

Resize Less - failing to resize small.bmp

Hi guys I've scratched my head about this for a week now and I'm struggling to see what the issue is. The smiley.bmp file seems to be resizing correctly but not the others. Can anyone offer some ...
GFitzP's user avatar
  • 19
1 vote
2 answers
47 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....
Afonso's user avatar
  • 11
0 votes
1 answer
30 views

pset3 resize less comfortable problem - mixed colour

I have been struggling with cs50 resize for quite some time. Can't figure out why my code is wrong. The output seems to have a right size but it is in a bunch of random colour. // Copies a BMP file ...
junyuanjyjy's user avatar
0 votes
1 answer
11 views

PLS help, not working

So this is my code and I really don't know where I am wrong. I followed the pseudocode but it still doesn't work. It compiles successfully, but it doesn't resize correctly or at least that is what ...
Stefan T's user avatar
0 votes
1 answer
60 views

writing pixels n times to array

i'm struggling trying to figure out how to store pixels n times to an array for (int i = 0, biHeight = abs(oldheight); i < biHeight; i++) { // iterate over pixels in scanline for (...
samia's user avatar
  • 3
0 votes
1 answer
93 views

Pset3 Resize (less) - working fine except on small.bmp

Currently doing resize (less) problem on the CS50 course and can't understand why this code is not working as it should. It will resize the large.bmp and the smiley.bmp but not the small.bmp ...
Chesny's user avatar
  • 27
0 votes
1 answer
39 views

PSET 3: Color is messed up

I can't figure out how to fix the colors of large.bmp when I run it. It resizes correctly but the pixels are all messed up and don't look like the original. Someone help me? Please and thank you! // ...
Lyle Boc's user avatar
0 votes
1 answer
37 views

CS50 Resize(less comfortable) I can't create OUTFILE

I've been working on this pset for quite a few days now, but my program doesn't seem to be compiling. It keeps saying "could not create outfile"(my message). I have no idea what to do. Any help would ...
Kevin's user avatar
  • 1
0 votes
1 answer
56 views

PSet 3: resize (less) bfsize error

I'm SO close (I think!) to being done with "Resize (Less)" after a grueling run. After running check50, I'm a bit kerfuffled. Hexadecimal form of output file seems correct, as do the values of and ...
LippStick's user avatar
0 votes
0 answers
26 views

debugger only check the first breakpoint then jump to the end of code

I have tried many times , the debugger can only check the first if statement and it can be step over in the first if statement. But When it finished the if statement, just jump to the end of code, ...
杨琳玲's user avatar
0 votes
1 answer
54 views

resize.c write to array

I think i made a breakthrough in this one with the rewrite method but i need to know how to write the triple to the array i tried a couple of things but didn't work out here's my code : int main(int ...
ox0o's user avatar
  • 33
0 votes
1 answer
48 views

resize less help needed

i'm feeling so close to solve it but have some issues with the for loops i tried to debug it and see what's going on but yet there's some things i can't explain specifically with triple variable i'm ...
ox0o's user avatar
  • 33
0 votes
1 answer
31 views

Confusion with understanding how new values are assigned

I do not quite understand how this reuse of variables is incorrect: // save initial values int initial_Height = bi.biHeight; int initial_Width = bi.biWidth; int initial_padding = (4 - (...
Alex Ljamin's user avatar
1 vote
1 answer
44 views

resize less help needed please

I've been watching the walkthrough for 3 days now and can't understand the whole idea, i read the spec and wrote couple lines of code finally i decided to write the code with only psuedocode in the ...
ox0o's user avatar
  • 33
0 votes
2 answers
35 views

What does the loop for padding do in Resize(less)?

// skip over padding, if any fseek(inptr, padding, SEEK_CUR); // then add it back (to demonstrate how) for (int k = 0; k < old_padding; k++) { ...
Ryan Hinchliffe's user avatar
0 votes
2 answers
72 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 ...
Leah's user avatar
  • 3
0 votes
1 answer
86 views

pset3 resize less

I'm having some problems and cannot seem to find the bugs. The program seems to function correctly but cs50 check says that the file is too large. Would love to have someone to look at my code and ...
asaf's user avatar
  • 3
0 votes
1 answer
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 *...
asaf's user avatar
  • 3
1 vote
1 answer
91 views

PSET3- Resize (Less)- Problem resizing horizontally

I've been stuck on this problem for over a week now, and even after reading answers to a few similar questions, I'm not getting where I'm going wrong :( Watching the walkthrough, I wasn't quite sure ...
curious4ever's user avatar
0 votes
1 answer
53 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 ...
Isaac Vernon's user avatar
0 votes
1 answer
38 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,...
Rohit Jain's user avatar
0 votes
1 answer
79 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 ...
Eric Forman's user avatar
0 votes
1 answer
51 views

PSET3 Resize (Less) - works in debug50 but segmentation error when executing

I'm working on resize (less comfortable) in pset3 and it returns segmentation error when I execute the code. However, when I try to work out which line actually went wrong using debug50 and go through ...
patrickw's user avatar
0 votes
1 answer
56 views

Is scan line not moving to the next line? I'm badly stuck. Please advice

I am getting only one green line, then a brown line and rest (about 90%) of the space filled with white and grey squares. I think, I am facing problem in moving the cursor to the next line. I tried to ...
Anirudh's user avatar
0 votes
1 answer
96 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++) { //...
KayO133's user avatar
  • 33
0 votes
1 answer
104 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 "...
Optimus 's user avatar
0 votes
1 answer
121 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 ...
wolfbagel's user avatar
  • 115
0 votes
1 answer
167 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 ...
Derek Connolly's user avatar
0 votes
1 answer
136 views

pset 3resize (less) how to store RGBTRIPLES in array

I am trying to store the RGB triples in the source file in an array, but I don't understand which variable type they are supposed to be. I have tried char, int, BYTE, unsigned long. The latter ...
Erik Masson's user avatar
1 vote
1 answer
132 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 ...
Bruno Fialho's user avatar
0 votes
1 answer
72 views

pset3 resize (less) compiles but doesn't write into new file for factor != 1

I've been stuck with the pset3 for a long time now and can't figure out why my code isn't working; it compiles fine but doesn't produce an image except for the factor 1. Could someone point me in the ...
Ivo's user avatar
  • 113
0 votes
1 answer
147 views

Pset 4 resize - problems with resizing

Can anyone help point out what's wrong with my resize algorithm? I have researched and tried out many ways to do it and watched the walkthrough so many times. Here's the resizing part of my code and ...
phillescatus's user avatar
0 votes
1 answer
66 views

[Pset 4 resize (less comfortable)]: problem with getting the correct RBG output

I have been stuck at Pset 4 resize (less comfortable) for some time. The program is expected to resize a bmp by a factor n. I get the correct image size but the pixel contents are not correct. Here ...
Gladys Lau's user avatar
0 votes
1 answer
162 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 ...
Leah Guecia's user avatar
1 vote
1 answer
1k views

PEST4 Resize (less comfortable)

Could you assist me to look at my codes, no idea why after resizing small imagine, it turns out very weird result. #include <stdio.h> #include <stdlib.h> #include <string.h> #...
WEI-WEN HUNG's user avatar
0 votes
1 answer
74 views

pset4 resize(less) vertical

My code seems only work for horizontal but not vertical. I have tried different for loops but nothing works. Any suggestions would be extremely helpful. Thank you. // Copies a BMP file #include <...
Issa's user avatar
  • 27
0 votes
1 answer
43 views

resize(less) am baffled dont know whats changed pls help

okay so yesterday I started resize and made a bit of progress, today I played around with it to try and fix the alignment issues I had and somehow totally screwed it up and now I'm getting colours ...
aoc's user avatar
  • 1
1 vote
1 answer
64 views

Could someone please tell me where I'm going wrong here in resize-less(pset4)?

#include <stdio.h> #include <stdlib.h> #include <string.h> #include "bmp.h" int main(int argc, char *argv[]) { // ensure proper usage if (argc != 4) { fprintf(stderr, "Usage: ...
user21692's user avatar
0 votes
1 answer
51 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 ...
user avatar
0 votes
1 answer
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 ...
lele701's user avatar
  • 21
0 votes
1 answer
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 ...
iHusk's user avatar
  • 3
0 votes
1 answer
115 views

Resize less comfortable; still stuck; cannot understand f(seek)

I thought I got it, but still stuck. any help appreciated /** * resizes bmp piece by piece */ include include include "bmp.h" int main(int argc, char *argv[]) { // ensure proper usage ...
stephen Ong's user avatar
0 votes
1 answer
261 views

Pset4 resize less comfortable; doesn;t resize; please help

#include <stdio.h> #include <stdlib.h> #include "bmp.h" int main(int argc, char *argv[]) { // ensure proper usage if (argc != 4) { fprintf(stderr, "Usage: ./copy ...
stephen Ong's user avatar
0 votes
1 answer
78 views

resize/less - testing with cs50/pset4/peek lits all green but check50 shows some error

I have tried many times to find the error but have failed to do so ... here is my resize/less code #include <stdio.h> #include <stdlib.h> #include "bmp.h" int main(int argc, char *argv[...
shaistha's user avatar
  • 117
0 votes
1 answer
111 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 ...
dmz's user avatar
  • 25