Руденко Илья Александрович P32101 (переделанная лаба)
6 unresolved threads
- Last updated by Илья Руденко
9 const uint32_t INFO_HEADERS_SIZE = 40; 10 const uint16_t PLANES = 1; 11 const uint16_t BIT_COUNT = 24; 12 const uint32_t X_PIXELS_PER_METER = 2834; 13 const uint32_t Y_PIXELS_PER_METER = 2834; 14 15 16 static size_t read_header(FILE* file, struct bmp_header* header); 17 static size_t write_header(FILE* file, struct image* image); 18 19 static size_t read_data(FILE* file, struct image* image); 20 static size_t write_data(FILE* file, struct image* image); 21 22 static uint32_t calculate_padding (uint32_t width); 23 24 uint32_t calculate_padding(uint32_t width) { changed this line in version 2 of the diff
19 FILE* in = fopen(argv[1], "rb"); 20 21 if (!in) { 22 print_error("Bad input file"); 23 24 return 1; 25 } 26 27 FILE* out = fopen(argv[2],"wb"); 28 29 if (!out) { 30 print_error("Bad output file"); 31 32 fclose(in); 33 return 1; 34 } Несколько разных ошибок возвращают одни и те же коды
Edited by Rodion Mustafin
- Last updated by Илья Руденко
47 return 1; 48 } 49 50 struct image rotated_image = rotate(&image); 51 52 enum write_status write_status = to_bmp(out, &rotated_image); 53 54 if (write_status != WRITE_OK) { 55 print_error("Errors while writing image"); 56 57 58 free(image.data); 59 free(rotated_image.data); 60 fclose(in); 61 fclose(out); 62 return 1; changed this line in version 2 of the diff
- Last updated by Илья Руденко
9 const uint32_t INFO_HEADERS_SIZE = 40; 10 const uint16_t PLANES = 1; 11 const uint16_t BIT_COUNT = 24; 12 const uint32_t X_PIXELS_PER_METER = 2834; 13 const uint32_t Y_PIXELS_PER_METER = 2834; 14 15 16 static size_t read_header(FILE* file, struct bmp_header* header); 17 static size_t write_header(FILE* file, struct image* image); 18 19 static size_t read_data(FILE* file, struct image* image); 20 static size_t write_data(FILE* file, struct image* image); 21 22 static uint32_t calculate_padding (uint32_t width); 23 24 uint32_t calculate_padding(uint32_t width) { changed this line in version 2 of the diff
20 uint32_t bOffBits; 21 uint32_t biSize; 22 uint32_t biWidth; 23 uint32_t biHeight; 24 uint16_t biPlanes; 25 uint16_t biBitCount; 26 uint32_t biCompression; 27 uint32_t biSizeImage; 28 uint32_t biXPelsPerMeter; 29 uint32_t biYPelsPerMeter; 30 uint32_t biClrUsed; 31 uint32_t biClrImportant; 32 }; 33 #pragma pack(pop) 34 35 enum read_status { @andrew сделал код ревью
@Sky_Chamber @andrew пофиксил