From 01eac0e6172aca0746fdf17e649942721d982c74 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Wed, 23 Jul 2014 12:49:49 +0100 Subject: [PATCH 1/3] Potential fix for lineart scanning (bug #1076954). Resolves: rhbz#1076954 --- hplip-lineart.patch | 14 ++++++++++++++ hplip.spec | 9 ++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 hplip-lineart.patch diff --git a/hplip-lineart.patch b/hplip-lineart.patch new file mode 100644 index 0000000..1580086 --- /dev/null +++ b/hplip-lineart.patch @@ -0,0 +1,14 @@ +diff -up hplip-3.14.6/scan.py.lineart hplip-3.14.6/scan.py +--- hplip-3.14.6/scan.py.lineart 2014-07-23 12:30:52.361517852 +0100 ++++ hplip-3.14.6/scan.py 2014-07-23 12:32:17.052940000 +0100 +@@ -977,8 +977,8 @@ try: + try: + pixels_per_line = bytes_per_line * 8 # Calculation of pixels_per_line for Lineart must be 8 time of bytes_per_line + # Otherwise, scanned image will be corrupted (slanted) +- im = Image.frombuffer('RGBA', (pixels_per_line, lines), buffer.read(), +- 'raw', 'RGBA', 0, 1).convert('L') ++ im = Image.frombuffer('1', (pixels_per_line, lines), buffer.read(), ++ 'raw', '1', 0, 1).convert('L') + except ValueError: + log.error("Did not read enough data from scanner (I/O Error?)") + sys.exit(1) diff --git a/hplip.spec b/hplip.spec index 946fba8..8b6f785 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.14.6 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ and MIT Url: http://hplip.sourceforge.net/ @@ -34,6 +34,7 @@ Patch17: hplip-codec.patch Patch18: hplip-log-stderr.patch Patch19: hplip-avahi-parsing.patch Patch20: hplip-reportlab.patch +Patch21: hplip-lineart.patch %global hpijs_epoch 1 Requires: hpijs%{?_isa} = %{hpijs_epoch}:%{version}-%{release} @@ -252,6 +253,9 @@ done # reportlab (bug #1121433). %patch20 -p1 -b .reportlab +# Potential fix for lineart scanning (bug #1076954). +%patch21 -p1 -b .lineart + sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -488,6 +492,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %postun libs -p /sbin/ldconfig %changelog +* Wed Jul 23 2014 Tim Waugh - 3.14.6-6 +- Potential fix for lineart scanning (bug #1076954). + * Mon Jul 21 2014 Tim Waugh - 3.14.6-5 - Main package requires gnupg (bug #1118724). - Fixed version comparisons for x.y.z-style versions such as From 622424b8081ccbcf9a3b23f26f140842f1fdae3c Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 26 Aug 2014 12:48:24 +0100 Subject: [PATCH 2/3] Reverted previous change as it didn't help (bug #1076954). --- hplip.spec | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hplip.spec b/hplip.spec index 8b6f785..287960d 100644 --- a/hplip.spec +++ b/hplip.spec @@ -7,7 +7,7 @@ Summary: HP Linux Imaging and Printing Project Name: hplip Version: 3.14.6 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ and MIT Url: http://hplip.sourceforge.net/ @@ -34,7 +34,6 @@ Patch17: hplip-codec.patch Patch18: hplip-log-stderr.patch Patch19: hplip-avahi-parsing.patch Patch20: hplip-reportlab.patch -Patch21: hplip-lineart.patch %global hpijs_epoch 1 Requires: hpijs%{?_isa} = %{hpijs_epoch}:%{version}-%{release} @@ -253,9 +252,6 @@ done # reportlab (bug #1121433). %patch20 -p1 -b .reportlab -# Potential fix for lineart scanning (bug #1076954). -%patch21 -p1 -b .lineart - sed -i.duplex-constraints \ -e 's,\(UIConstraints.* \*Duplex\),//\1,' \ prnt/drv/hpcups.drv.in @@ -492,6 +488,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %postun libs -p /sbin/ldconfig %changelog +* Tue Aug 26 2014 Tim Waugh - 3.14.6-7 +- Reverted previous change as it didn't help (bug #1076954). + * Wed Jul 23 2014 Tim Waugh - 3.14.6-6 - Potential fix for lineart scanning (bug #1076954). From 298dff827d0526671e16f6a107153daa5e2ab40f Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 26 Aug 2014 12:46:32 +0100 Subject: [PATCH 3/3] Updated udev-rules patch so that firmware is reloaded on demand (bug #1033952). --- hplip-udev-rules.patch | 13 ------------- hplip.spec | 2 ++ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/hplip-udev-rules.patch b/hplip-udev-rules.patch index 37de4e1..206e786 100644 --- a/hplip-udev-rules.patch +++ b/hplip-udev-rules.patch @@ -1,16 +1,3 @@ -diff -up hplip-3.14.3/data/rules/56-hpmud.rules.udev-rules hplip-3.14.3/data/rules/56-hpmud.rules ---- hplip-3.14.3/data/rules/56-hpmud.rules.udev-rules 2014-03-07 10:06:30.338946358 +0100 -+++ hplip-3.14.3/data/rules/56-hpmud.rules 2014-03-07 10:10:25.004683464 +0100 -@@ -11,9 +11,6 @@ LABEL="hpmud_usb_rules" - ATTR{idVendor}=="03f0", ATTR{idProduct}=="????", OWNER="root", GROUP="lp", MODE="0664", ENV{sane_hpaio}="yes", ENV{libsane_matched}="yes", ENV{hp_test}="yes", ENV{ID_HPLIP}="1" - - --# This rule will add the printer and install plugin --ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c 'if [ -f /usr/bin/systemctl ]; then /usr/bin/systemctl --no-block start hplip-printer@$env{BUSNUM}:$env{DEVNUM}.service; else /usr/bin/nohup /usr/bin/python /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM} ; fi &'" -- - # If sane-bankends is installed add hpaio backend support to dll.conf if needed. - ENV{sane_hpaio}=="yes", RUN+="/bin/sh -c 'grep -q ^#hpaio /etc/sane.d/dll.conf;if [ $$? -eq 0 ];then sed -i -e s/^#hpaio/hpaio/ /etc/sane.d/dll.conf;else grep -q ^hpaio /etc/sane.d/dll.conf;if [ $$? -ne 0 ];then echo hpaio >>/etc/sane.d/dll.conf;fi;fi'" - diff -up hplip-3.14.3/Makefile.in.udev-rules hplip-3.14.3/Makefile.in --- hplip-3.14.3/Makefile.in.udev-rules 2014-03-06 06:11:18.000000000 +0100 +++ hplip-3.14.3/Makefile.in 2014-03-07 10:06:30.341946316 +0100 diff --git a/hplip.spec b/hplip.spec index 287960d..86946ed 100644 --- a/hplip.spec +++ b/hplip.spec @@ -490,6 +490,8 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop %changelog * Tue Aug 26 2014 Tim Waugh - 3.14.6-7 - Reverted previous change as it didn't help (bug #1076954). +- Updated udev-rules patch so that firmware is reloaded on demand, now + the command to do it just does that (bug #1033952). * Wed Jul 23 2014 Tim Waugh - 3.14.6-6 - Potential fix for lineart scanning (bug #1076954).