- 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);