|
|
@@ -78,13 +78,18 @@ int main(int argc, char *argv[]) { |
|
|
|
} |
|
|
|
|
|
|
|
struct image_data * original_image = decompress_image(infile); |
|
|
|
fclose(infile); |
|
|
|
|
|
|
|
if (original_image == NULL) { |
|
|
|
fprintf(stderr, "Failed to decompress image %s\n", input_filename); |
|
|
|
exit(1); |
|
|
|
} |
|
|
|
|
|
|
|
// If no output file were specified, use original image |
|
|
|
FILE *outfile; |
|
|
|
if (out_filename == NULL) { |
|
|
|
out_filename = input_filename; |
|
|
|
} |
|
|
|
|
|
|
|
if ((outfile = fopen(out_filename, "wb")) == NULL) { |
|
|
|
fprintf(stderr, "Can not open %s\n", out_filename); |
|
|
@@ -128,6 +133,8 @@ int main(int argc, char *argv[]) { |
|
|
|
int8_t compress_result; |
|
|
|
compress_result = compress_image(blurred_image, outfile, 90); |
|
|
|
|
|
|
|
fclose(outfile); |
|
|
|
|
|
|
|
if (compress_result != 0) { |
|
|
|
fprintf(stderr, "Failed to write blurred image to file!\n"); |
|
|
|
|
|
|
|