diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-05-24 21:03:56 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-05-24 21:03:56 +0200 |
commit | 58912f68c2489bcee787599837447e0d64dfd61a (patch) | |
tree | dda50aadde35fe152da1a8d50769987ace0f1496 /backend/epsonds-ops.c | |
parent | cfd27ef2ad8b005fd47ab41ef29b71d9e3d48201 (diff) |
New upstream version 1.0.27upstream/1.0.27
Diffstat (limited to 'backend/epsonds-ops.c')
-rw-r--r-- | backend/epsonds-ops.c | 23 |
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 ... */ |