From 841680f6108abaa1ebb032137fa5a4850011a8a3 Mon Sep 17 00:00:00 2001 From: thierry1970 Date: Wed, 16 Dec 2020 13:41:31 +0100 Subject: [PATCH 1/2] Fix : Fixes the crash of devices that do not have a tray, discovered on the HP Deskjet 3760 device. --- backend/escl/escl.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/backend/escl/escl.c b/backend/escl/escl.c index 0b923c6f0..f680879ea 100644 --- a/backend/escl/escl.c +++ b/backend/escl/escl.c @@ -578,8 +578,25 @@ init_options(SANE_String_Const name_source, escl_sane_t *s) s->scanner->source = PLATEN; if (source == s->scanner->source) return status; } - else - s->scanner->source = PLATEN; + if (s->scanner->caps[s->scanner->source].ColorModes == NULL) { + if (s->scanner->caps[PLATEN].ColorModes) + s->scanner->source = PLATEN; + else if (s->scanner->caps[ADFSIMPLEX].ColorModes) + s->scanner->source = ADFSIMPLEX; + else if (s->scanner->caps[ADFDUPLEX].ColorModes) + s->scanner->source = ADFDUPLEX; + else + return SANE_STATUS_INVAL; + } + if (s->scanner->source == PLATEN) { + DBG (10, "SOURCE PLATEN.\n"); + } + else if (s->scanner->source == ADFDUPLEX) { + DBG (10, "SOURCE ADFDUPLEX.\n"); + } + else if (s->scanner->source == ADFSIMPLEX) { + DBG (10, "SOURCE ADFSIMPLEX.\n"); + } memset (s->opt, 0, sizeof (s->opt)); memset (s->val, 0, sizeof (s->val)); for (i = 0; i < NUM_OPTIONS; ++i) { From 6ad6352342812305e575fba632f8b83c0cb9c7d1 Mon Sep 17 00:00:00 2001 From: thierry1970 Date: Wed, 16 Dec 2020 13:50:24 +0100 Subject: [PATCH 2/2] Add model HP Deskjet 3760. --- doc/descriptions/escl.desc | 5 +++++ doc/sane-escl.man | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/descriptions/escl.desc b/doc/descriptions/escl.desc index 2c82aca5c..f6a6d428a 100644 --- a/doc/descriptions/escl.desc +++ b/doc/descriptions/escl.desc @@ -107,6 +107,11 @@ :status :good :comment "All resolutions supported." +:model "DeskJet 3760" +:interface "WiFi" +:status :good +:comment "All resolutions supported." + :model "LaserJet MFP M28w" :interface "WiFi" :status :untested diff --git a/doc/sane-escl.man b/doc/sane-escl.man index 136d60dc7..2f9dbf5b9 100644 --- a/doc/sane-escl.man +++ b/doc/sane-escl.man @@ -27,7 +27,7 @@ CANON PIXMA TR8500, TR8520 .br EPSON ET3740, ET4750 .br -HP DESKJET 2710, DESKJET 2723, LASERJET MFP M28W, +HP DESKJET 2710, DESKJET 2723, DESKJET 3760, LASERJET MFP M28W, .br HP OFFICEJET 4630, OFFICEJET PRO 8610 .br