From c0bfdb484deaec09b0b1609cc96563f694b60331 Mon Sep 17 00:00:00 2001 From: Andrew Haynes Date: Sun, 22 Mar 2026 18:51:47 -0400 Subject: [PATCH] pls --- src/imgio.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/imgio.c b/src/imgio.c index ca77ac8..8e622c9 100644 --- a/src/imgio.c +++ b/src/imgio.c @@ -1,4 +1,5 @@ #include "image/imgio.h" + #include #include #include @@ -93,6 +94,7 @@ ppm_save(const unsigned int* buf, const PPM img) return 10; } + printf("test 1"); fprintf(fptr, "P%c\n%d %d\n255\n", img.fmt, img.width, img.height); if (img.fmt == '3') { @@ -108,6 +110,7 @@ ppm_save(const unsigned int* buf, const PPM img) } } } + printf("test 2"); if (img.fmt == '6') { for (int i = 0; i < img.len; i++) @@ -118,6 +121,7 @@ ppm_save(const unsigned int* buf, const PPM img) } fwrite(dst_buf, 1, img.len * 3, fptr); } + printf("test 3"); fclose(fptr); free(dst_buf); printf("Encode Done!\n"); @@ -195,7 +199,7 @@ transcode_to_jpeg(PPM* in, JPEG* out) out->width = in->width; out->height = in->height; jpeg_save(dst, out, out->name); - free(dst); + free(dst); } void @@ -206,26 +210,26 @@ transcode_to_ppm(JPEG* input, PPM* out) out->height = input->height; out->len = out->width * out->height; ppm_save(dst, *out); - free(dst); + free(dst); } PPM -inherit_from_jpeg(const JPEG* in, const char fmt) { - PPM image = { - .width = in->width, - .height = in->height, - .len = in->width * in->height, - .fmt = fmt - }; - return image; +inherit_from_jpeg(const JPEG* in, const char fmt) +{ + PPM image = { .width = in->width, + .height = in->height, + .len = in->width * in->height, + .fmt = fmt }; + return image; } JPEG -inherit_from_ppm(const PPM* in) { - JPEG image = { - .width = in->width, - .height = in->height, - .len = in->width * in->height, - }; - return image; +inherit_from_ppm(const PPM* in) +{ + JPEG image = { + .width = in->width, + .height = in->height, + .len = in->width * in->height, + }; + return image; }