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
290 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
290 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
2answers
60 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
117 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
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
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
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
279 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
150 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
498 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
1answer
246 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
154 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
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
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
80 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
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
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
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
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
54 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
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
1answer
81 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
55 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) 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 ...
0
votes
1answer
350 views

pset4 resize less output issues

Have been trying to figure out what's wrong with my code, but having issues with it. Can someone please point me in the right direction? What I'm getting with check50 :) resize.c and bmp.h exist. ...
1
vote
1answer
813 views

BITMAPFILEHEADER bf in resize.c

typedef struct { WORD bfType; DWORD bfSize; WORD bfReserved1; WORD bfReserved2; DWORD bfOffBits; } __attribute__((__packed__)) BITMAPFILEHEADER; And then in the resize.c: BITMAPFILEHEADER ...
0
votes
1answer
125 views

What is wrong with my code? - Resize Pset4

I'm Samuel and I have been working on Problem Set 4 and I have been working a long time on resize. I have refined it several times but can't find what is wrong with my code. Could you please help me? ...
0
votes
1answer
248 views

Resize fails check50 when images and headers are identical

I have checked everything and searched everywhere for an answer. Both the images and headers were identical, but check50 gives me this: :) resize.c and bmp.h exist. :) resize.c compiles. :) doesn'...
0
votes
1answer
143 views

pset4 resize working but failing checks?

it works, but cant get past test 4 :) resize.c and bmp.h exist. :) resize.c compiles. :) doesn't resize 3x3-pixel BMP when n is 1 :( resizes 3x3-pixel BMP to 6x6 correctly when n is 2 resized ...
1
vote
1answer
467 views

Looking for clarification on PSET4 Resize - "Rewrite" method

Can I request for some help on my resize.c pset? I'm trying to do the "rewrite" method as per the pset's walkthrough. The pseudocode is as follows: 1 for each row 2 for each pixel 3 write ...
0
votes
1answer
175 views

pset4 resize fails check50

I can't figure out what is wrong with my implementation of resize (less). It resizes small.bmp correctly but check50 gives this: :) resize.c and bmp.h exist. :) resize.c compiles. :( doesn't resize ...
0
votes
2answers
262 views

CS50 resize "Invalid or Unsupported Image Format" in the IDE

I know that this question has been "answered" numerous times but those revelations haven't related to me for some reason. My code is edited from copy.c and a few other resources. The FILE reads and ...
0
votes
1answer
35 views

Resize duplicating only some rows

I'm so close but when resizing the smiley, my code is only resizing certain rows. Any ideas why? /** * Copies a BMP piece by piece, just because. */ #include <stdio.h> #include <stdlib.h>...
0
votes
1answer
216 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
1answer
70 views

resize unsigned integer overflow problem ? I did try the -(long int) and long offset for -offset but still the same error

Please, as I wrote, I tried both for long integer in fseek but still I have the unsigned integer overflow message. Can u help me pls ? tsk here the code : // data increase by the n value for ...
0
votes
1answer
123 views

Pset 4 Resize Rewrite - Vertical but not Horizontal

I'm sure there's an easy solution I'm just missing, but my code resizes by 4 vertically, but rather than the appropriately sized white box a "bar" of white runs across the middle. RGBTRIPLE triple;...
0
votes
1answer
210 views

Pset 4 Resize fseek()?

I'm looking over my resize code rn, but have been stuck for a while now, was wondering if anyone could point me in the right direction. The resized images have colors beside green, which I would ...
0
votes
1answer
45 views

Pset4 resize - only partially working

I've been struggling with this for a while. After reading other posters questions and reading the responses I've managed to come up with code that compiles and works correctly only if the value of 'n' ...
0
votes
1answer
194 views

Pset4 resize strange resized image and does not resize after some value

I am stuck since I have no idea what is wrong with my code. I believe my resizing code is correct. I think I'm not changing the headers correctly, which is giving me this image: Also, i think it ...
0
votes
0answers
34 views

Resize does not compile

I wrote the code for Resize, saved it and compiled it. But it does not compile. Instead, it gives a super long error message. ~/workspace/pset4/resize/ $ make resize clang -fsanitize=integer -...
0
votes
1answer
100 views

pset 4 (resize) - wrong colors on resized image

my program compiles and the dimensions of the resized document are fine; the problem lies in the colors. About half the pixels are fine but everything else is variously colored and I don't have any ...
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 2 3
4
5
13