Don't exit with error when trying to set inactive options. This especially

happens in connection with geometry options and the v4l backend (bugs #300321,
#301977).
merge-requests/1/head
Henning Geinitz 2005-08-14 14:51:06 +00:00
rodzic 46cfa92d35
commit 3ae9b03454
2 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -8,6 +8,9 @@
image. Increased safety margin for backtracking. This fixes the image. Increased safety margin for backtracking. This fixes the
"garbled image" bug. Set default gamma value to 2. Manpage "garbled image" bug. Set default gamma value to 2. Manpage
update. Status set to "basic". update. Status set to "basic".
* frontend/scanimage.c: Don't exit with error when trying to set
inactive options. This especially happens in connection with
geometry options and the v4l backend (bugs #300321, #301977).
2005-08-13 Henning Meier-Geinitz <henning@meier-geinitz.de> 2005-08-13 Henning Meier-Geinitz <henning@meier-geinitz.de>

Wyświetl plik

@ -929,6 +929,13 @@ set_option (SANE_Handle device, int optnum, void *valuep)
SANE_Int info; SANE_Int info;
opt = sane_get_option_descriptor (device, optnum); opt = sane_get_option_descriptor (device, optnum);
if (opt && (!SANE_OPTION_IS_ACTIVE (opt->cap)))
{
if (verbose > 0)
fprintf (stderr, "%s: ignored request to set inactive option %s\n",
prog_name, opt->name);
return;
}
if (opt->size == sizeof (SANE_Word) && opt->type != SANE_TYPE_STRING) if (opt->size == sizeof (SANE_Word) && opt->type != SANE_TYPE_STRING)
orig = *(SANE_Word *) valuep; orig = *(SANE_Word *) valuep;