Bmp file C black&white

So given a certain image I have to make it black and white. This is my code for reading and changing the pixels: fseek(inFile, pHeader->imageDataOffset, SEEK_SET); int sum = 0; for(i = 0; i < InfoHeader->height; i++){ for(j = 0; j < InfoHeader->width; j++){ fread(&Image[i][j].Red, sizeof(Pixel->Red), 1, input); fread(&Image[i][j].Green, sizeof(Pixel->Green), 1, input); fread(&Image[i][j].Blue, sizeof(Pixel->Blue), 1,…

Details

Laravel, How to ignore (except) some fields when update model using json and laravel

The function below is to update user information, I need to validate if email is not duplicated, also to ignore password if its field left empty, I don’t why this function not working! public function update(Request $request, $id) { $this->validate($request->all(), [ ‘fname’ => ‘required’, ’email’ => ‘required|email|unique:users,email,’.$id, ‘password’ => ‘same:confirm-password’, ‘roles’ => ‘required’ ]); $input…

Details