Questions tagged [recover]

recover.c, one of the assignments for Problem Set 4, will challenge you to search through the raw bytes of a camera's digital memory to recover a bunch of "deleted" JPEG images.

Filter by
Sorted by
Tagged with
0
votes
1answer
70 views

pset4 recover incorrectly generate images

I need your help with pset4 recover, as image does not recover correctly. And I would like to have more understanding on how file pointer works. Below is what I have written which generate no correct ...
0
votes
1answer
87 views

Using fseek in Pset4 recover to iterate through the binary file (one 512 Byte block at a time)

I just have a conceptual question for how fread and fseek works in the context of the pset4's recover assignment. Initially when I was trying to write my program for this assignment, I was using fseek ...
0
votes
1answer
90 views

Pset 4 - Fopen returns NULL

Currently working on the Pset4 recover.c assignment. My code compiles correctly, however, when I execute, fopen return NULL. Based on my understanding from the shorts on file pointer and the lecture, ...
0
votes
1answer
60 views

pset4 Recover - need to break (^C) to exit

I'm recovering the files just fine, but my program seems stuck in the while loop. I've tried adding extra closing statements and adding else statements, but I can't seem to find where/why it won't ...
0
votes
1answer
109 views

Please could I get some help with pset4 recover

Please could I get some help with my code for Pset4's recover? I have been stuck on it for about 8 hours today and cannot work out why it isn't working. I think the current issue is that my current[] ...
0
votes
1answer
73 views

Pset3 Recover - need some help with my logic. Compiles but generates nothing

struggling as usual. I can't seem to figure out what I'm missing here. It compiles ok but when I run it nothing seems to happen. Any pointers to what I am missing? It is probably something looking ...
0
votes
1answer
51 views

PSET4 Recover timing out

My code works for the card.raw that is given part of the problem set. However, it times out when I use check50. Does anyone know why even though the code compiles rather quickly for the card.raw? Or ...
0
votes
1answer
73 views

One tiny step to completion. Recover recovers all images except the first one. Help!

Alrighty. I just need someone to point out to me where the issue is so i can finish this thing. submit it. and move on. i'm so so close. so help would be greatly appreciated. // include libraries #...
0
votes
1answer
43 views

How to identify cause of Segmentation Faults?

Working on problem set 4- Recover but keep getting Segmentation Fault. Tried valgrind too, but could not figure it out. Could anyone kindly anyone look into the code and tell me where does the ...
0
votes
1answer
48 views

Pset4 recover final jpg is mismatch

I am getting all 49 images, on check50 i get the message that the 049.jpg is mismatch.I am trying to debug, but i am getting a seg fault error. #include <stdio.h> #include <stdlib.h> #...
0
votes
0answers
30 views

strange bug in pset 4 recover

I solved pset 4 recover, but one of the bugs in my program which I removed, I found the code which was causing the problem but I don't know why it was. At the end of my program I was freeing up ...
0
votes
1answer
48 views

PSET4 Recover Segmentation Fault, please help

I hope everyone is doing well during this difficult time, my prayers to those been affected by it. I have difficulty debugging the segmentation fault here and the cs50 debugger is not too helpful on ...
0
votes
1answer
117 views

Pset4: Recover, only 49 images and fails with check50

I recently started with CS50 and I struggle a bit with pset4's recover. While the jpgs look correct to me, my code only recovers 49 jpgs total, not the 50 which are expected. Check50 fails on the ...
0
votes
1answer
48 views

Help with pset5 'recover': incomplete jpgs

I´ve been working on recover for the past few days and I am having some trouble getting a working solution. The code below prints out 49 jpgs instead of 50, and they are all incomplete or very blurry. ...
0
votes
1answer
21 views

CS50 Recover outputs random symbols instead of JPEGS

I am working on pset4 recover in CS50 and I think I am almost done it. The files that it outputs though appear as a bunch of random symbols instead of a jpeg, I'm not sure why this is occurring but ...
0
votes
1answer
60 views

PSET 4- RECOVER getting 22 pictures and none good

I keep looking my code and connot identify what is going on. I open 22 pictures, but none of them are good. It doesn't even write in the entire picture, some of them just a part of the picture is ...
0
votes
1answer
95 views

Pset4/recover: code is working fine but the recoverd images are not correct

I have written this code. The code seems to work fine but the images are not correct they are distorted. I have attached those photos below. Can you please help me and tell me where I went wrong in ...
0
votes
1answer
79 views

PSET4 Recover- code working fine except recovered image 49 does not match

I keep ending up with this last error on Check50 - any tips? int main(int argc, char *argv[]) { // Check for invalid usage if (argc != 2) { printf("Usage: Recover [...
0
votes
2answers
130 views

pset4 recover - timed out while waiting for program to exit

Whenever I run my code using check50, I get this error: "timed out while waiting for program to exit", and I don't know why this is happening. Any help would be greatly appreciated. Here's my code: #...
0
votes
1answer
56 views

Pset4 Recover: Program works perfectly but jpeg 1 name is not three digits for some reason HELP!

Everything works except the first jpeg gets the name 1 instead of 001 #include <stdio.h> #include <stdlib.h> #include <stdint.h> //includes BYTE struct #include <cs50.h> ...
0
votes
1answer
64 views

pset4 recover: 'recovered image does not match'

My program recovers the images but the recovered images are all blank and check50 says that they "don't match". All the images are 512 bytes in size. Please help me find out why this is happening. My ...
0
votes
1answer
48 views

Recovered Images not clear

I having trouble generating clear images. I am able to generate the 50 JPEGs but they are just random colors or pixelated. I am however, not receiving an "Invalid or unsupported" file format error. I ...
0
votes
1answer
1k views

cs50 pset4 recover 2020

I have been working on pset4 recover, but it is bringing one error how can i rectify it? Here is my code FILE* card_ptr = fopen("card.raw", "r"); if (card_ptr == NULL) { printf("...
0
votes
0answers
49 views

Recover - Program only opens 24 valid JPEGs

Having a lot of trouble figuring out why my program can only open 24 valid JPEGs before closing. Tried using the debug50 program however when attempting to debug and a breakpoint is placed beyond ...
0
votes
1answer
85 views

pset4: recover last check wrong

All check correct and it recovers all 50 images but I have this problem and I can't solve it. I know I must find return number from fread function but the return number is 1 no all the elements that ...
0
votes
1answer
57 views

Why is it saying it did not recover any images?

So it seems like I am almost done with recover. My code recover all the pictures except the fist one and last one. On the first one it only recovers a small block on the top right corner. Also the ...
0
votes
1answer
316 views

Debug50 Running through breakpoints

I am trying to use debug50 for PSET 4 (Recover). However, when I set the breakpoints the debugger runs through them and do not pause. Only when I set the breakpoint at the if statement shown in the ...
0
votes
1answer
48 views

Why is fwrite not writing the image except for the second one?

So my code creates the correct number of files in the correct format but they are all empty with the exception of number two that had the first couple of lines but the rest is also empty. Why is it ...
0
votes
1answer
71 views

Why is nothing happening?

I know their is defiantly something wrong and missing to my code but i'm stuck and can't figure out what is missing. It complies and when I run it does not do anything visible. #include <stdio....
0
votes
1answer
73 views

Recover PSET 4 - 26 Invalid Images

Been struggling with the recover PSET for a while now, my code recovers 26 images but when i try to open them i get the following error "Invalid or Unsupported Image Format ". I believe it's because ...
0
votes
1answer
75 views

Segmentation fault pset4 recover

I'm having a segmentation fault which I'm not being able to identify. After reading about other similar problems I thought it could be that I wasn't checking if (img == NULL) but even after adding it ...
1
vote
0answers
24 views

Empty pointer values in Pset 3: “Recover”

I know pointers don't have to be used in this pset, but my first attempt relies on them. The program has other bugs, but I'm wondering why my pointer variable doesn't get values (keep staying empty) ...
0
votes
1answer
61 views

pset 3 Recover Segmentation fault

So, after some manipulations with my code I`ve got to Segmentation fault. Here is my code so far #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { // ensure ...
0
votes
2answers
86 views

recover.c images recovering correctly, but 049.jpg test case failing

The title explains the issue, not really sure why the test case is failing because the logic seems to work. I'm assuming it has to do with reading some unnecessary bytes near the end, but I haven't ...
0
votes
1answer
34 views

jpegs don't process correctly nor do they have correct names

my recover.c goes through the raw file and then opens up new jpg files but only the first one has the correct name 001.jpg the rest have long code names such as 8767661.jpg. Additionally, none of them ...
0
votes
1answer
51 views

PSET3 -I am getting segmentation fault

I am getting seg fault over and over again. Could anyone help out please. I am pretty sure the functional part of the code, the while loop, should be working properly. Thanks in advance. #include &...
0
votes
1answer
38 views

Segmentation fault on PSET3 recover

My program compiles, but wherever it runs I recieve a segmentation fault error. However i cannot see where the source of the problem is: #include <stdio.h> #include <stdlib.h> #include &...
0
votes
1answer
221 views

PSET4 Recover munmap_chunk(): invalid pointer

This my solution to recover problem. It works, but it produces "munmap_chunk(): invalid pointer" error: And Valgrind outputs: ==5906== LEAK SUMMARY: ==5906== definitely lost: 0 bytes in 0 ...
0
votes
1answer
61 views

pset 3 recover - JPEGs don't match

#include <stdio.h> include include int main(int argc, char *argv[]) { //ensure proper usage if (argc != 2) { fprintf(stderr, "Usage: /recover infile\n"); return ...
0
votes
1answer
70 views

Recover: Problem when writing info into image

I'm having trouble when creating the JPG files. The amount of images created and the name is fine, but the content of the image is wrong. Here is my code: int main(int argc, char *argv[]) { if( ...
0
votes
1answer
84 views

Having trouble getting recover off the ground

I'm sorry to do this but I'm fairly lost with this pset3 recover for cs50. I've been researching for hours and am no closer to figuring out how to utilize FILE *outptr = fopen and sprintf(filename, "%...
0
votes
1answer
52 views

Recover: Segmentation fault

Everytime I try to run this code, it gives me a segmentation fault error. What is wrong with my logic? #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { // ...
0
votes
1answer
69 views

Pset4 - Recover: Weird output

This problem set is the worst and it made me cry 🤣 Take a look at this code: #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { // ...
0
votes
1answer
28 views

PSET 3 recover I can't open pointers. Always returns a NULL value

Whenever I try to run this code, it returns "could not open file", which means that jptr is assigned a null value. I don't know how to get rid of this, tried so many solutions. It keeps on happening ...
0
votes
1answer
41 views

pset3 Recover will not find the start of a JPEG

Having some trouble with problem set 3's recover. Running the code below I get a segmentation error but using the debugger I found that the program would not find the start of a JPEG even though the ...
0
votes
1answer
298 views

Recover cs50 Please help!

Can somebody please help with this question? ... and also I tried to debug and apparently it doesn't run my while loop and i don't understand why. while (fread(buffer, 512, 1, fraw) == 1) so ...
0
votes
1answer
64 views

(Recover) Segmentation fault

I was trying to complete the recover problem and it's giving me a segmentation fault. Any help would be appreciated. #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #...
0
votes
1answer
108 views

CS50 Recover.c | No idea what and where i'm going wrong | Can't debug or compile in CS50 IDE

I'm trying to debug in CS50 IDE but I'm continuously receiving this error; debug50: recover: No such file. and if I try to compile it says this "make: *** No rule to make target 'recover'. Stop." ...
0
votes
1answer
72 views

Still stuck on Recover Pset3, but getting closer

really sorry, not sure how to format copy-and-pasted code so it renders correctly in this forum. I'm hoping for a hint or two on how to get my Recover program (PSet 3, 2018) to work. I'm able to get ...
0
votes
1answer
66 views

pset3 “Recover”

I am facing some troubles, only one blank image is generated , any help? // Program to recover lost photos. #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <...

1 2 3
4
5
18