diff --git a/libs/spandsp/src/spandsp/t4_tx.h b/libs/spandsp/src/spandsp/t4_tx.h index 76fdd970a6..3e04237fe0 100644 --- a/libs/spandsp/src/spandsp/t4_tx.h +++ b/libs/spandsp/src/spandsp/t4_tx.h @@ -203,8 +203,12 @@ ImageLayer(34732) LONG #define TIFFTAG_T82OPTIONS 435 #define TIFFTAG_STRIPROWCOUNTS 559 #define TIFFTAG_IMAGELAYER 34732 +#endif +#if !defined(COMPRESSION_T85) #define COMPRESSION_T85 9 +#endif +#if !defined(COMPRESSION_T43) #define COMPRESSION_T43 10 #endif diff --git a/libs/spandsp/src/t30.c b/libs/spandsp/src/t30.c index 7772459aba..38f160d7ff 100644 --- a/libs/spandsp/src/t30.c +++ b/libs/spandsp/src/t30.c @@ -1179,9 +1179,9 @@ int t30_build_dis_or_dtc(t30_state_t *s) if ((s->supported_modems & T30_SUPPORT_V17)) s->local_dis_dtc_frame[4] |= (DISBIT6 | DISBIT4 | DISBIT3); if ((s->supported_resolutions & T30_SUPPORT_FINE_RESOLUTION)) - set_ctrl_bit(s->local_dis_dtc_frame, 15); + set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_200_200_CAPABLE); if ((s->supported_compressions & T30_SUPPORT_T4_2D_COMPRESSION)) - set_ctrl_bit(s->local_dis_dtc_frame, 16); + set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_2D_CAPABLE); /* 215mm wide is always supported */ if ((s->supported_image_sizes & T30_SUPPORT_303MM_WIDTH)) set_ctrl_bit(s->local_dis_dtc_frame, 18); @@ -2002,6 +2002,11 @@ static int start_sending_document(t30_state_t *s) if (s->use_own_tz) t4_tx_set_header_tz(&s->t4.tx, &s->tz); + if (tx_start_page(s)) + return -1; + s->x_resolution = t4_tx_get_x_resolution(&s->t4.tx); + s->y_resolution = t4_tx_get_y_resolution(&s->t4.tx); + s->image_width = t4_tx_get_image_width(&s->t4.tx); /* The minimum scan time to be used can't be evaluated until we know the Y resolution, and must be evaluated before the minimum scan row bits can be evaluated. */ if ((min_row_bits = set_min_scan_time_code(s)) < 0) @@ -2012,11 +2017,6 @@ static int start_sending_document(t30_state_t *s) span_log(&s->logging, SPAN_LOG_FLOW, "Minimum bits per row will be %d\n", min_row_bits); t4_tx_set_min_bits_per_row(&s->t4.tx, min_row_bits); - if (tx_start_page(s)) - return -1; - s->x_resolution = t4_tx_get_x_resolution(&s->t4.tx); - s->y_resolution = t4_tx_get_y_resolution(&s->t4.tx); - s->image_width = t4_tx_get_image_width(&s->t4.tx); if (s->error_correcting_mode) { if (get_partial_ecm_page(s) == 0) diff --git a/libs/spandsp/src/t4_tx.c b/libs/spandsp/src/t4_tx.c index 3f77cc70f4..82cf97026e 100644 --- a/libs/spandsp/src/t4_tx.c +++ b/libs/spandsp/src/t4_tx.c @@ -985,7 +985,7 @@ SPAN_DECLARE(void) t4_tx_get_transfer_statistics(t4_tx_state_t *s, t4_stats_t *t t->pages_transferred = s->current_page - s->start_page; t->pages_in_file = s->tiff.pages_in_file; t->x_resolution = s->metadata.x_resolution; - t->y_resolution = s->metadata.y_resolution; + t->y_resolution = s->metadata.y_resolution/s->row_squashing_ratio; t->encoding = s->line_encoding; switch (s->line_encoding) {