From 90ce069cb73a68a368113ff1e7e33d658c9d44cb Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Sun, 3 Feb 2008 18:42:26 +0100 Subject: [PATCH] Fix some stupidness. --- qscale.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/qscale.c b/qscale.c index 3bb1b34..7943f90 100644 --- a/qscale.c +++ b/qscale.c @@ -354,9 +354,16 @@ int main(int argc, char **argv) dinfo.raw_data_out = TRUE; jpeg_start_decompress(&dinfo); - unsigned w0 = dinfo.image_width * samp_h0 / max_samp_h, h0 = dinfo.image_height * samp_v0 / max_samp_v; - unsigned w1 = dinfo.image_width * samp_h1 / max_samp_h, h1 = dinfo.image_height * samp_v1 / max_samp_v; - unsigned w2 = dinfo.image_width * samp_h2 / max_samp_h, h2 = dinfo.image_height * samp_v2 / max_samp_v; + unsigned w0 = dinfo.image_width * dinfo.comp_info[0].h_samp_factor / dinfo.max_h_samp_factor; + unsigned h0 = dinfo.image_height * dinfo.comp_info[0].v_samp_factor / dinfo.max_v_samp_factor; + + unsigned w1 = dinfo.image_width * dinfo.comp_info[1].h_samp_factor / dinfo.max_h_samp_factor; + unsigned h1 = dinfo.image_height * dinfo.comp_info[1].v_samp_factor / dinfo.max_v_samp_factor; + + unsigned w2 = dinfo.image_width * dinfo.comp_info[2].h_samp_factor / dinfo.max_h_samp_factor; + unsigned h2 = dinfo.image_height * dinfo.comp_info[2].v_samp_factor / dinfo.max_v_samp_factor; + + fprintf(stderr, "h0 = %u, h1=%u, h2=%u\n", h0, h1, h2); fprintf(stderr, "Scaling using Lanczos filter:\n"); fprintf(stderr, " Y component: %ux%u -> %ux%u\n", dinfo.comp_info[0].width_in_blocks * DCTSIZE, dinfo.comp_info[0].height_in_blocks * DCTSIZE, nw0, nh0); -- 2.39.2