Package: libsane1
Version: 1.0.31-2.0.1
Severity: normal
Tags: patch upstream
X-Debbugs-Cc: sh200...@mail.ru

After upgrade to libsane 1.0.31-2 my scanner started to ignore brightness and
contrast settings.

The upstream issue is https://gitlab.com/sane-project/backends/-/issues/271. I
can confirm that the patch proposed there fixes the bug for me.

Attaching a patch that fixes the bug.

-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.8.0-2-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8), LANGUAGE=ru
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libsane1 depends on:
ii  acl                2.2.53-8
ii  adduser            3.118
ii  libavahi-client3   0.8-3
ii  libavahi-common3   0.8-3
ii  libc6              2.31-3
ii  libcairo2          1.16.0-4
ii  libcurl3-gnutls    7.72.0-1
ii  libgcc-s1          10.2.0-9
ii  libglib2.0-0       2.66.0-2
ii  libgphoto2-6       2.5.25-3
ii  libgphoto2-port12  2.5.25-3
ii  libieee1284-3      0.2.11-14
ii  libjpeg62-turbo    1:2.0.5-1.1
ii  libpng16-16        1.6.37-3
ii  libpoppler-glib8   20.09.0-2
ii  libsane-common     1.0.31-2
ii  libsnmp40          5.9+dfsg-3
ii  libstdc++6         10.2.0-9
ii  libtiff5           4.1.0+git191117-2
ii  libusb-1.0-0       2:1.0.23-2
ii  libxml2            2.9.10+dfsg-6
ii  udev               246.6-1

Versions of packages libsane1 recommends:
ii  ipp-usb     0.9.13-1
ii  sane-utils  1.0.31-2

Versions of packages libsane1 suggests:
ii  avahi-daemon  0.8-3
ii  hplip         3.20.5+dfsg0-3+b1

-- 
Alexander Kernozhitsky
Description: Disable the gamma only if the flags say so

The previous behavior made my scanner ignore brightness and contrast settings.
The patch is tested to work with Canon CanoScan LiDE 60, though it may fix
the issue for another scanners (issues with CanoScan LiDE 35 were also reported)

Author: Alexander Kernozhitsky <sh200...@mail.ru>
Last-Update: 2020-10-05

--- sane-backends-1.0.31.orig/backend/genesys/low.cpp
+++ sane-backends-1.0.31/backend/genesys/low.cpp
@@ -640,11 +640,6 @@ bool should_enable_gamma(const ScanSessi
     if ((session.params.flags & ScanFlag::DISABLE_GAMMA) != ScanFlag::NONE) {
         return false;
     }
-    if (sensor.gamma[0] == 1.0f || sensor.gamma[1] == 1.0f || sensor.gamma[2] == 1.0f) {
-        return false;
-    }
-    if (session.params.depth == 16)
-        return false;
 
     return true;
 }

Reply via email to