found a few answers to the segmentation fault issue in CS50 recover while closing the file but I couldn't translate the answers to my issue:
The last part: fclose(f); fclose(img); is resulting into seg fault in my case. I've posted my code below. Please help. Thanks!
[EDIT: Code removed for honor code compliance.]