| jpeg_create_compress(&cinfo); | jpeg_create_compress(&cinfo); | ||||
| jpeg_stdio_dest(&cinfo, out); | jpeg_stdio_dest(&cinfo, out); | ||||
| cinfo.image_width = width; | |||||
| cinfo.image_height = height; | |||||
| cinfo.image_width = width - blur_radius * 2; | |||||
| cinfo.image_height = height - blur_radius * 2; | |||||
| cinfo.input_components = 3; | cinfo.input_components = 3; | ||||
| cinfo.in_color_space = JCS_RGB; | cinfo.in_color_space = JCS_RGB; | ||||
| JSAMPROW row_pointer[1]; | JSAMPROW row_pointer[1]; | ||||
| while (cinfo.next_scanline < cinfo.image_height) { | while (cinfo.next_scanline < cinfo.image_height) { | ||||
| row_pointer[0] = &image[cinfo.next_scanline * bytes_per_line]; | |||||
| row_pointer[0] = &image[(cinfo.next_scanline + blur_radius) * bytes_per_line + blur_radius * 3]; | |||||
| jpeg_write_scanlines(&cinfo, row_pointer, 1); | jpeg_write_scanlines(&cinfo, row_pointer, 1); | ||||
| } | } | ||||
| fprintf(stderr, "Error parsing resolution '%s'\n", argv[1]); | fprintf(stderr, "Error parsing resolution '%s'\n", argv[1]); | ||||
| return EXIT_FAILURE; | return EXIT_FAILURE; | ||||
| } | } | ||||
| desired_width += blur_radius * 2; | |||||
| desired_height += blur_radius * 2; | |||||
| FILE *in; | FILE *in; | ||||
| if (strcmp(argv[2], "-") == 0) { | if (strcmp(argv[2], "-") == 0) { |