X-Git-Url: https://git.sesse.net/?p=fjl;a=blobdiff_plain;f=driver.c;h=b12b226c336dcc29ea9993f521fbd8f393ec8f79;hp=fd861f25d7b56250aadf7f1666174e9fb2fe9b41;hb=e58d7fc6e17349a9a456632f9403a73262a428e5;hpb=a733460846675aab7117c5cf1213d1b62785793d diff --git a/driver.c b/driver.c index fd861f2..b12b226 100644 --- a/driver.c +++ b/driver.c @@ -214,8 +214,9 @@ void read_scan(struct byte_source* source, struct jpeg_image* image, huffman_tab const int c = 1; if (mcu_y == image->num_blocks_vertical) { unsigned stride = image->num_blocks_horizontal * image->hsample[c] * DCTSIZE; - printf("P5\n%u %u\n255\n", stride, image->height); - fwrite(image->pixel_data[c], stride * image->height, 1, stdout); + unsigned height = image->num_blocks_vertical * image->vsample[c] * DCTSIZE; + printf("P5\n%u %u\n255\n", stride, height); + fwrite(image->pixel_data[c], stride * height, 1, stdout); } } }