diff -ru hplip-3.20.5.orig/scan/sane/escl.c hplip-3.20.5/scan/sane/escl.c --- hplip-3.20.5.orig/scan/sane/escl.c 2020-05-11 16:34:00.000000000 +0300 +++ hplip-3.20.5/scan/sane/escl.c 2020-07-08 08:26:36.932679242 +0300 @@ -853,6 +853,14 @@ /* Get scan parameters for sane client. */ ps->bb_get_parameters(ps, params, ps->ip_handle ? SPO_STARTED : SPO_BEST_GUESS); + /* ADF has dynamic image height */ + switch (ps->currentInputSource) { + case IS_ADF: + case IS_ADF_DUPLEX: + params->lines = -1; + break; + } + /*_DBG("sane_hpaio_get_parameters(): format=%d, last_frame=%d, lines=%d, depth=%d, pixels_per_line=%d, bytes_per_line=%d\n", params->format, params->last_frame, params->lines, params->depth, params->pixels_per_line, params->bytes_per_line); */