summaryrefslogtreecommitdiff
path: root/backend/epsonds-ops.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-07-15 11:29:05 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-07-15 11:29:05 +0200
commit324a8a71bb7d9e4f8bc49b6bc47efaf9fb58282e (patch)
treebd2d48a139bfbe869f4f49359b63097931a45e7b /backend/epsonds-ops.c
parent2ca8a81bd0d99fe4d75c229d0e988d8ef710285f (diff)
parent1edb02101a9306fc711cd422ed507d18165b1691 (diff)
Merge branch 'release/experimental/1.0.27-1_experimental1'experimental/1.0.27-1_experimental1
Diffstat (limited to 'backend/epsonds-ops.c')
-rw-r--r--backend/epsonds-ops.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/backend/epsonds-ops.c b/backend/epsonds-ops.c
index 403cd58..f7a07fb 100644
--- a/backend/epsonds-ops.c
+++ b/backend/epsonds-ops.c
@@ -72,6 +72,18 @@ eds_dev_post_init(struct epsonds_device *dev)
return SANE_STATUS_GOOD;
}
+SANE_Bool
+eds_is_model(epsonds_device *dev, const char *model)
+{
+ if (dev->model == NULL)
+ return SANE_FALSE;
+
+ if (strncmp(dev->model, model, strlen(model)) == 0)
+ return SANE_TRUE;
+
+ return SANE_FALSE;
+}
+
SANE_Status
eds_add_resolution(epsonds_device *dev, int r)
{
@@ -199,6 +211,12 @@ eds_init_parameters(epsonds_scanner *s)
s->dummy = 0;
+ /* setup depth according to our mode table */
+ if (mode_params[s->val[OPT_MODE].w].depth == 1)
+ s->params.depth = 1;
+ else
+ s->params.depth = s->val[OPT_DEPTH].w;
+
dpi = s->val[OPT_RESOLUTION].w;
if (SANE_UNFIX(s->val[OPT_BR_Y].w) == 0 ||
@@ -246,11 +264,6 @@ eds_init_parameters(epsonds_scanner *s)
* The default color depth is stored in mode_params.depth:
*/
- if (mode_params[s->val[OPT_MODE].w].depth == 1)
- s->params.depth = 1;
- else
- s->params.depth = s->val[OPT_DEPTH].w;
-
/* this works because it can only be set to 1, 8 or 16 */
bytes_per_pixel = s->params.depth / 8;
if (s->params.depth % 8) { /* just in case ... */