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
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 = ...
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
72 views

Why is my code not working? resize (less comfortable)

So what I tried to do here is to copy every pixel in each of infile's scanlines as many times as the factor provided, then go back to the start of the scanline and do it again but on the next row, so ...
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
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
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
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
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
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
69 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 ...
2
votes
1answer
95 views

Pset 3: Resize gives me green vertical strip and black vertical strip

Apologies that I cannot be more specific here, I've been through my code with the debugger multiple times and have reviewed other examples online but I'm stuck on PSET3 resize. I think I'm saving ...
0
votes
1answer
98 views

Stuck for weeks at resize...help needed

I have been stuck at resize(less comfortable) for 3 weeks now. I have written the following code and can't tell why its not resizing and instead IDE is showing that the image is unsupported or invalid....
0
votes
1answer
404 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
vote
1answer
315 views

Problem Set 3 (Resize) Help

I have been working for a while now, and I have a few questions regarding the Resize problem set. My code makes sense to me intuitively, but I am sure I went wrong somewhere, as my output is clearly ...
0
votes
1answer
140 views

resize pset3, getting stuck between the lines

Seems to be working on the first line of resizing, but then something is missing and not copying the correct RGB Triples - the color scheme gets completely off... Have tried playing with all the ...
0
votes
1answer
60 views

Help in Resize, biSize headers not sizing correctly

#include <stdio.h> #include <cs50.h> #include <stdlib.h> #include <math.h> #include "bmp.h" int main(int argc, char *argv[]) { // ensure proper usage if (argc != 4) ...
0
votes
1answer
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 ...
0
votes
1answer
37 views

How to know the position of the cursor when debugging? PSET4 RESIZE

I am trying to debug PSET4 resize. Is there a way to track the position of the cursor in both the infile and the outfile when debugging (by number or something)? If not, is there a better way to ...
0
votes
1answer
64 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 ...
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
70 views

pset4 resize less - starting to despair!

I'm utterly stuck on this pset. I don't want to give up on the course, but I've spent weeks and weeks looking on forums for help and I still have no idea where my code is going wrong. I'd really ...
0
votes
1answer
40 views

PSET4 Resize Only works for half an image

So I thought I finished but the image only half way is written. Not sure what I did wrong but the image scales but only the top half. I tried both ways I could think of for the loop but decided using ...
1
vote
1answer
1k views

PSET 4 - resize.c less

This is my code: // Resizes a BMP file pixel by pixel, given a factor n #include <stdio.h> #include <stdlib.h> #include "bmp.h" int main(int argc, char *argv[]) { // ensure proper ...
0
votes
1answer
53 views

Pset4 Colors random

I've looked through a couple of threads and forum questions but I am not able to figure out what are the problems with my code. It resizes correctly but puts out random colors. // Copies a BMP file #...
0
votes
1answer
18 views

PSET4 Invalid File Format when going from n = 1 to n = 2

// Copies a BMP file #include <stdio.h> #include <stdlib.h> #include "bmp.h" int main(int argc, char *argv[]) { // ensure proper usage if (argc != 4) { fprintf(stderr, "Please give ...
0
votes
1answer
53 views

PSET4 Resize I don't understand what I'm doing wrong

I'm really sorry to be asking for help but I've been searching for answers and I just don't understand what I'm doing wrong. I think I must be messing something up with the horizontal resize and the ...
0
votes
1answer
195 views

resize.c (less) using the rewrite method

My issue is that the BMP appears to resize properly (in terms of size, that is) - so I don't think I have any problems with changing and updating the Bitmap Info/File-Headers (I probably do...), and ...
0
votes
1answer
81 views

Resize.c "Header field biWidth doesn't match"

I can't seem to figure out how to resolve "Header field biWidth doesn't match." error from the check50. I've gone through my code, but cannot figure out what to change in regards to my biWidth header. ...
0
votes
1answer
28 views

CS50 Resize - Program runs but no output file + problem in vertical resizing

I'm stuck with the resize exercise. I can compile and run the program (no error messages) but no new output file appears. Where did I go wrong? Also, my vertical resizing does not seem to work but I ...
0
votes
1answer
42 views

Resize less - Some part of code gives right output. Image has fewer bytes than expected err message

resize(less) ~cs50/pset4/peek student.bmp staff.bmp checks out fine.but check50 fives this error : Connecting...... Authenticating...... Preparing............. Uploading............ Checking..........
0
votes
1answer
68 views

Resize.c code outputs only top half of image

For some reason my resize code only resizes the top half of an image and stops after that. Any help will be much appreciated. #include <cs50.h> #include <stdio.h> #include <stdlib.h>...
0
votes
2answers
64 views

Memory Leak - PSET4

Hello, I have completed PSET 4 and passed check50 (at least, for the less comfortable version). However, I somehow have a memory leak of 11 bytes that I cannot diagnose. My complete code is here: ...
0
votes
1answer
80 views

resize less comfortable recopy - issues

been on this problem for over a month now. Still cannot resize images as required. When I run code, only the first row is resized. Other pixels return unmatched pixel colours. I would appreciate any ...
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 ...
0
votes
1answer
81 views

Resize - Struggling to obtain correct bytes

This is the relevant portion of my code: // iterate over infile's scanlines for (int i = 0, biHeight = abs(bi.biHeight); i < biHeight; i++) { // iterate over pixels in scanline for (int j =...

1
2
3 4 5
13