From 90cfe68276c3639bb340956754dd726284f7b822 Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Sun, 31 May 2009 02:30:22 +0200 Subject: [PATCH] Minor adjustments to code that does not work. --- driver.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/driver.c b/driver.c index 1411b51..20d64f2 100644 --- a/driver.c +++ b/driver.c @@ -185,8 +185,13 @@ void read_scan(struct byte_source* source, struct jpeg_image* image, huffman_tab } } - if (cn == 1 && ++xb * DCTSIZE == y_stride) { - fwrite(y_row_data, y_stride * DCTSIZE * image->vsample[1], 1, stdout); + if (cn != 1) { + continue; + } + + xb += image->hsample[cn]; + if (xb * DCTSIZE == y_stride) { + fwrite(y_row_data, y_stride * DCTSIZE * image->vsample[cn], 1, stdout); xb = 0; } } -- 2.39.2