From ea47cbcc7901c39fc82a0abd9606c05ff0f494f2 Mon Sep 17 00:00:00 2001 From: Alexander Pevzner Date: Mon, 17 Mar 2025 15:21:23 +0300 Subject: [PATCH] WSD: fixed "scan-intent" option handling on ADF Duplex source Unlike eSCL, WSD scanners define their input capabilities not as ADFSimplex/ADFDulpex, but as ADFFront/ADFBack, where ADFBack element is optional. If both elements are present, we assume that ADFDuplex capabilities are result of devcaps_source_merge() capabilities, which fund subset of capabilities, supported by both sources. By mistake, devcaps_source_merge() didn't handle scan intents properly, so intents were lost for the "ADF Duplex" source. --- airscan-devcaps.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/airscan-devcaps.c b/airscan-devcaps.c index 701f3ba..b224c92 100644 --- a/airscan-devcaps.c +++ b/airscan-devcaps.c @@ -77,6 +77,9 @@ devcaps_source_merge (const devcaps_source *s1, const devcaps_source *s2) goto FAIL; } + /* Merge scanintents */ + src->scanintents = s1->scanintents & s2->scanintents; + /* Merge dimensions */ src->min_wid_px = math_max(s1->min_wid_px, s2->min_wid_px); src->max_wid_px = math_min(s1->max_wid_px, s2->max_wid_px);