summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfelics2019-11-08 16:08:08 +0100
committerfelics2019-11-08 16:08:08 +0100
commit12165a298efeb918306b2869864a93ffca117961 (patch)
treedfcce5e90d7c2efb0e09423e975d6ed1073df81d
downloadaur-12165a298efeb918306b2869864a93ffca117961.tar.gz
Initial commit.
-rw-r--r--.SRCINFO52
-rw-r--r--0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch50
-rw-r--r--0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch29
-rw-r--r--PKGBUILD142
-rw-r--r--disable_upgrade.patch14
-rw-r--r--hplip-colorlaserjet-mfp-m278-m281.patch64
-rw-r--r--hplip-raw-ledm-PKGBUILD.patch39
-rw-r--r--hpscan-ledm-raw.patch139
8 files changed, 529 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..fa21d8d67f39
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,52 @@
+pkgbase = hplip-3.18
+ pkgdesc = HPLIP, fixed version 3.18.x (with supports for some printers which were removed in 3.19), and with patch for uncompressed scanning on LEDM-based peripherals.
+ pkgver = 3.18.12
+ pkgrel = 1
+ url = http://hplipopensource.com
+ arch = x86_64
+ license = GPL
+ makedepends = python-pyqt5
+ makedepends = python-gobject
+ makedepends = sane
+ makedepends = rpcbind
+ makedepends = cups
+ makedepends = libusb
+ depends = python-dbus
+ depends = ghostscript
+ depends = net-snmp
+ depends = foomatic-db-engine
+ optdepends = cups: for printing support
+ optdepends = sane: for scanner support
+ optdepends = xsane: sane scanner frontend
+ optdepends = python-pillow: for commandline scanning support
+ optdepends = python-reportlab: for pdf output in hp-scan
+ optdepends = rpcbind: for network support
+ optdepends = python-pyqt5: for running GUI and hp-toolbox
+ optdepends = python-gobject: for running hp-toolbox
+ optdepends = libusb: for advanced usb support
+ optdepends = wget: for network support
+ optdepends = hplip-plugin: binary blobs for specific devices (AUR) or run hp-setup to download the plugin
+ provides = hplip=3.18.12
+ provides = hplip-raw-ledm=3.18.12
+ conflicts = hplip
+ conflicts = hplip-raw-ledm
+ backup = etc/hp/hplip.conf
+ backup = etc/sane.d/dll.d/hpaio
+ source = http://downloads.sourceforge.net/hplip/hplip-3.18.12.tar.gz
+ source = http://downloads.sourceforge.net/hplip/hplip-3.18.12.tar.gz.asc
+ source = disable_upgrade.patch
+ source = hpscan-ledm-raw.patch
+ source = 0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
+ source = 0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
+ source = hplip-colorlaserjet-mfp-m278-m281.patch
+ validpgpkeys = 4ABA2F66DBD5A95894910E0673D770CDA59047B9
+ sha1sums = 48a3c2dc95bfb83f3a5296de214e6d893c912cb6
+ sha1sums = SKIP
+ sha1sums = 2348bcbca0c52dc09cceb47ed13281a4ccb9d83e
+ sha1sums = 7e4b095d8bf9a0af9f0d035ca37691f733e271e0
+ sha1sums = 2ef86972ab51c0fdcb8bfc653b9f6f69459449a5
+ sha1sums = 0e36f31b98faf2f14137431bc8f82b74de22705b
+ sha1sums = 89e0ed0ed9acc6e50812c843ffb5f996fffb829e
+
+pkgname = hplip-3.18
+
diff --git a/0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch b/0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
new file mode 100644
index 000000000000..491c3072b3e0
--- /dev/null
+++ b/0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch
@@ -0,0 +1,50 @@
+From b3a7fa4d4a573cfe0073ae50197f679af7e3a0ac Mon Sep 17 00:00:00 2001
+From: Till Kamppeter <till.kamppeter@canonical.com>
+Date: Sat, 24 Sep 2016 10:37:20 +0200
+Subject: Add 'include <cups/ppd.h>' in various places as CUPS 2.2 moved some
+ definitions to ppd.h
+
+---
+ configure.in | 2 +-
+ prnt/hpcups/HPCupsFilter.h | 2 ++
+ prnt/hpijs/hpcupsfax.cpp | 1 +
+ 3 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index d3a1ddb..eabe14a 100755
+--- a/configure.in
++++ b/configure.in
+@@ -554,7 +554,7 @@ fi
+
+ if test "$hpijs_only_build" = "no" && test "$hpcups_only_build" = "no"; then
+ AC_CHECK_LIB([cups], [cupsDoFileRequest], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libcups support], 9)])
+- AC_CHECK_HEADERS(cups/cups.h, ,[AC_MSG_ERROR([cannot find cups-devel support], 3)])
++ AC_CHECK_HEADERS(cups/cups.h cups/ppd.h, ,[AC_MSG_ERROR([cannot find cups-devel support], 3)])
+ if test "$libusb01_build" = "yes"; then
+ AC_CHECK_LIB([usb], [usb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb support], 2)])
+ AC_CHECK_HEADERS(usb.h, ,[AC_MSG_ERROR([cannot find libusb-devel support], 11)])
+diff --git a/prnt/hpcups/HPCupsFilter.h b/prnt/hpcups/HPCupsFilter.h
+index ff5548e..c517989 100644
+--- a/prnt/hpcups/HPCupsFilter.h
++++ b/prnt/hpcups/HPCupsFilter.h
+@@ -38,6 +38,8 @@
+
+ #include "dbuscomm.h"
+
++#include <cups/ppd.h>
++
+ #define DBITMAPFILEHEADER 14
+ #define DBITMAPINFOHEADER 40
+
+diff --git a/prnt/hpijs/hpcupsfax.cpp b/prnt/hpijs/hpcupsfax.cpp
+index 8514775..994e50f 100644
+--- a/prnt/hpijs/hpcupsfax.cpp
++++ b/prnt/hpijs/hpcupsfax.cpp
+@@ -43,6 +43,7 @@
+ #include <arpa/inet.h>
+ #include <math.h>
+ #include <cups/cups.h>
++#include <cups/ppd.h>
+ #include <cups/raster.h>
+ #include <string>
+ #ifdef FALSE
diff --git a/0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch b/0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
new file mode 100644
index 000000000000..f3a8c1732b0b
--- /dev/null
+++ b/0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch
@@ -0,0 +1,29 @@
+From 04b5a1ddac1dd90c5a392f23aaf7df42eae32918 Mon Sep 17 00:00:00 2001
+From: Gaurav Sood <gaurav-sood@invalid-email.launchpad.net>
+Date: Thu, 4 May 2017 18:32:08 +0200
+Subject: Fix handling of unicode filenames in sixext.py
+
+LP: #1480152
+Closes: #861731
+---
+ base/sixext.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/base/sixext.py b/base/sixext.py
+index 0bf4fc4f4..311bf72c6 100644
+--- a/base/sixext.py
++++ b/base/sixext.py
+@@ -110,11 +110,11 @@ if PY3:
+
+
+ def to_string_utf8(s):
+- return s.decode("utf-8")
++ return s.decode("utf-8", 'ignore')
+
+
+ def to_string_latin(s):
+- return s.decode("latin-1")
++ return s.decode("latin-1", 'ignore')
+
+
+ def to_unicode(s, enc=None):
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c9bd1687da9d
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,142 @@
+# Maintainer: Dreieck
+# Contributor: Andreas Radke <andyrtr@archlinux.org>
+# Contributor: Tom Gundersen <teg@jklm.no>
+# Contributor : Rémy Oudompheng <remy@archlinux.org>
+# Contributor: Morgan LEFIEUX <comete@archlinuxfr.org>
+
+# PKGBUILD based on [hplip-raw-ledm](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=hplip-raw-ledm) from 2019-11-08.
+
+_pkgname=hplip
+_pkgmainver=3.18
+pkgname="${_pkgname}-${_pkgmainver}"
+pkgver="${_pkgmainver}.12"
+pkgrel=1
+pkgdesc="HPLIP, fixed version 3.18.x (with supports for some printers which were removed in 3.19), and with patch for uncompressed scanning on LEDM-based peripherals."
+arch=('x86_64')
+url="http://hplipopensource.com"
+license=('GPL')
+depends=(
+ 'python-dbus'
+ 'ghostscript'
+ 'net-snmp'
+ 'foomatic-db-engine'
+ )
+makedepends=('python-pyqt5' 'python-gobject' 'sane' 'rpcbind' 'cups' 'libusb')
+optdepends=(
+ 'cups: for printing support'
+ 'sane: for scanner support'
+ 'xsane: sane scanner frontend'
+ 'python-pillow: for commandline scanning support'
+ 'python-reportlab: for pdf output in hp-scan'
+ 'rpcbind: for network support'
+ 'python-pyqt5: for running GUI and hp-toolbox'
+ 'python-gobject: for running hp-toolbox'
+ 'libusb: for advanced usb support'
+ 'wget: for network support'
+ 'hplip-plugin: binary blobs for specific devices (AUR) or run hp-setup to download the plugin'
+ )
+provides=(
+ "hplip=${pkgver}"
+ "hplip-raw-ledm=${pkgver}"
+ )
+conflicts=(
+ 'hplip'
+ 'hplip-raw-ledm'
+ )
+backup=(
+ 'etc/hp/hplip.conf'
+ 'etc/sane.d/dll.d/hpaio'
+ )
+source=(
+ "http://downloads.sourceforge.net/hplip/hplip-${pkgver}.tar.gz"
+ "http://downloads.sourceforge.net/hplip/hplip-${pkgver}.tar.gz.asc"
+ "disable_upgrade.patch"
+ "hpscan-ledm-raw.patch"
+ "0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch"
+ "0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch"
+ "hplip-colorlaserjet-mfp-m278-m281.patch"
+ )
+sha1sums=(
+ '48a3c2dc95bfb83f3a5296de214e6d893c912cb6'
+ 'SKIP'
+ '2348bcbca0c52dc09cceb47ed13281a4ccb9d83e'
+ '7e4b095d8bf9a0af9f0d035ca37691f733e271e0'
+ '2ef86972ab51c0fdcb8bfc653b9f6f69459449a5'
+ '0e36f31b98faf2f14137431bc8f82b74de22705b'
+ '89e0ed0ed9acc6e50812c843ffb5f996fffb829e'
+ )
+validpgpkeys=('4ABA2F66DBD5A95894910E0673D770CDA59047B9') # HPLIP (HP Linux Imaging and Printing) <hplip@hp.com>
+
+prepare() {
+ cd "${_pkgname}-${pkgver}"
+
+ # disable insecure update - https://bugs.archlinux.org/task/38083
+ patch -Np0 -i "${srcdir}/disable_upgrade.patch"
+
+ # add missing 'include <cups/ppd.h>' at various places
+ patch -Np1 -i "${srcdir}/0022-Add-include-cups-ppd.h-in-various-places-as-CUPS-2.2.patch"
+ # fix some handling unicode file names FS#58412
+ patch -Np1 -i "${srcdir}/0023-Fix-handling-of-unicode-filenames-in-sixext.py.patch"
+ # add support for some missing models - FS#57683
+ patch -Np1 -i "${srcdir}/hplip-colorlaserjet-mfp-m278-m281.patch"
+
+ # patch hpscan
+ patch -Np1 -i "${srcdir}/hpscan-ledm-raw.patch"
+
+ export AUTOMAKE='automake --foreign'
+ autoreconf --force --install
+}
+
+build() {
+ cd "${_pkgname}-${pkgver}"
+ ./configure \
+ --prefix=/usr \
+ --enable-qt5 \
+ --disable-qt4 \
+ --enable-hpcups-install \
+ --enable-cups-drv-install \
+ --enable-pp-build \
+ --disable-qt3 \
+ --enable-doc-build \
+ --disable-hpijs-only-build \
+ --disable-lite-build \
+ --disable-hpcups-only-build \
+ --disable-hpijs-install \
+ --disable-new-hpcups \
+ --enable-hpps-install \
+ --enable-network-build \
+ --enable-pp-build \
+ --disable-class-driver \
+ --enable-scan-build \
+ --enable-gui-build \
+ --enable-fax-build \
+ --disable-apparmor_build \
+ --enable-dbus-build \
+ --disable-cups11-build \
+ --disable-udev_sysfs_rules \
+ --disable-shadow-build \
+ --disable-libusb01_build \
+ --disable-foomatic-ppd-install \
+ --disable-foomatic-drv-install \
+ --disable-cups-ppd-install \
+ --disable-foomatic-rip-hplip-install \
+ --enable-policykit \
+ # --help
+ make
+}
+
+package() {
+ cd "${_pkgname}-${pkgver}"
+ make -j1 rulesdir='/usr/lib/udev/rules.d' DESTDIR="${pkgdir}/" install
+
+ # remove config provided by sane and autostart of hp-daemon
+ rm -rf "${pkgdir}/etc"/{sane.d,xdg}
+ install -dm755 "${pkgdir}/etc/sane.d/dll.d"
+ echo hpaio > "${pkgdir}/etc/sane.d/dll.d/hpaio"
+
+ # remove HAL .fdi file because HAL is no longer used
+ rm -vrf "${pkgdir}/usr/share/hal"
+
+ # remove rc script
+ rm -vrf "${pkgdir}/etc/init.d"
+}
diff --git a/disable_upgrade.patch b/disable_upgrade.patch
new file mode 100644
index 000000000000..f7d8fb3222f4
--- /dev/null
+++ b/disable_upgrade.patch
@@ -0,0 +1,14 @@
+--- upgrade.py.orig 2013-10-31 12:46:54.000000000 +0100
++++ upgrade.py 2013-12-04 14:58:03.000000000 +0100
+@@ -134,6 +134,11 @@ except getopt.GetoptError, e:
+ if os.getenv("HPLIP_DEBUG"):
+ log.set_level('debug')
+
++
++log.error("HPLIP upgrade is disabled by Archlinux for security reasons, see https://bugs.archlinux.org/task/38083 - if you like to upgrade HPLIP, use the Archlinux software package manager pacman.")
++clean_exit(1)
++
++
+ for o, a in opts:
+ if o in ('-h', '--help'):
+ usage()
diff --git a/hplip-colorlaserjet-mfp-m278-m281.patch b/hplip-colorlaserjet-mfp-m278-m281.patch
new file mode 100644
index 000000000000..8e9569f2075d
--- /dev/null
+++ b/hplip-colorlaserjet-mfp-m278-m281.patch
@@ -0,0 +1,64 @@
+diff -up hplip-3.17.11/data/models/models.dat.colorlaserjet-mfp-m278-m281 hplip-3.17.11/data/models/models.dat
+--- hplip-3.17.11/data/models/models.dat.colorlaserjet-mfp-m278-m281 2017-11-23 13:10:17.000000000 +0100
++++ hplip-3.17.11/data/models/models.dat 2018-01-19 08:24:21.554788787 +0100
+@@ -58516,6 +58516,59 @@ usb-pid=3c2a
+ usb-vid=3f0
+ wifi-config=3
+
++[hp_colorlaserjet_mfp_m278-m281]
++align-type=0
++clean-type=0
++color-cal-type=0
++copy-type=0
++embedded-server-type=1
++fax-type=7
++fw-download=False
++icon=hp_color_laserjet_cm1312_mfp.png
++io-mfp-mode=1
++io-mode=1
++io-support=14
++job-storage=0
++linefeed-cal-type=0
++model1=HP Color LaserJet MFP M278-281
++monitor-type=0
++panel-check-type=0
++pcard-type=0
++plugin=1
++plugin-reason=64
++power-settings=0
++ppd-name=hp-color_laserjet_pro_mfp_m277
++pq-diag-type=0
++r-type=0
++r0-agent1-kind=4
++r0-agent1-sku=CF400A/CF400X
++r0-agent1-type=1
++r0-agent2-kind=4
++r0-agent2-sku=CF401A
++r0-agent2-type=4
++r0-agent3-kind=4
++r0-agent3-sku=CF403A
++r0-agent3-type=5
++r0-agent4-kind=4
++r0-agent4-sku=CF402A
++r0-agent4-type=6
++scan-src=3
++scan-type=5
++status-battery-check=0
++status-dynamic-counters=0
++status-type=10
++support-released=True
++support-subtype=48c3
++support-type=2
++support-ver=3.15.4
++tech-class=Postscript
++family-class=Undefined
++tech-subclass=Normal
++tech-type=4
++usb-pid=3c2a
++usb-vid=3f0
++wifi-config=3
++
+ [hp_color_laserjet_m553]
+ align-type=0
+ clean-type=0
+
diff --git a/hplip-raw-ledm-PKGBUILD.patch b/hplip-raw-ledm-PKGBUILD.patch
new file mode 100644
index 000000000000..393263a8d05d
--- /dev/null
+++ b/hplip-raw-ledm-PKGBUILD.patch
@@ -0,0 +1,39 @@
+--- PKGBUILD.orig 2019-11-08 15:45:24.622273183 +0100
++++ PKGBUILD 2019-11-08 15:49:19.612271708 +0100
+@@ -42,2 +42,5 @@
+
++provides+=("hplip=${pkgver}")
++conflicts+=('hplip')
++options+=('ccache')
+ prepare() {
+@@ -69,3 +72,29 @@
+ --enable-cups-drv-install \
+- --enable-pp-build #--help
++ --enable-pp-build \
++ --disable-qt3 \
++ --enable-doc-build \
++ --disable-hpijs-only-build \
++ --disable-lite-build \
++ --disable-hpcups-only-build \
++ --disable-hpijs-install \
++ --disable-new-hpcups \
++ --enable-hpps-install \
++ --enable-network-build \
++ --enable-pp-build \
++ --disable-class-driver \
++ --enable-scan-build \
++ --enable-gui-build \
++ --enable-fax-build \
++ --disable-apparmor_build \
++ --enable-dbus-build \
++ --disable-cups11-build \
++ --disable-udev_sysfs_rules \
++ --disable-shadow-build \
++ --disable-libusb01_build \
++ --disable-foomatic-ppd-install \
++ --disable-foomatic-drv-install \
++ --disable-cups-ppd-install \
++ --disable-foomatic-rip-hplip-install \
++ --enable-policykit \
++ #--help
+ make
diff --git a/hpscan-ledm-raw.patch b/hpscan-ledm-raw.patch
new file mode 100644
index 000000000000..255bfe0094a5
--- /dev/null
+++ b/hpscan-ledm-raw.patch
@@ -0,0 +1,139 @@
+diff --git a/scan/sane/bb_ledm.c b/scan/sane/bb_ledm.c
+index bf2c093..318ea5c 100644
+--- a/scan/sane/bb_ledm.c
++++ b/scan/sane/bb_ledm.c
+@@ -189,7 +189,7 @@ Keep-Alive: 20\r\nProxy-Connection: keep-alive\r\nCookie: AccessCounter=new\r\n0
+ <YStart>%d</YStart>\
+ <Height>%d</Height>\
+ <Format>%s</Format>\
+-<CompressionQFactor>15</CompressionQFactor>\
++<CompressionQFactor>0</CompressionQFactor>\
+ <ColorSpace>%s</ColorSpace>\
+ <BitDepth>%d</BitDepth>\
+ <InputSource>%s</InputSource>\
+@@ -234,6 +234,38 @@ Keep-Alive: 300\r\nProxy-Connection: keep-alive\r\nCookie: AccessCounter=new\r\n
+ # define JOBSTATE_COMPLETED "<j:JobState>Completed</j:JobState>"
+ # define PRESCANPAGE "<PreScanPage>"
+
++static int parse_status_elements(const char *payload, int size, struct wscn_create_scan_job_response *resp)
++{
++ char tag[512];
++ char value[128];
++ char *tail=(char *)payload;
++
++ while (1)
++ {
++ get_tag(tail, size-(tail-payload), tag, sizeof(tag), &tail);
++
++ if (!tag[0])
++ break;
++
++ if (strncmp(tag, "ImageWidth", 10) == 0)
++ {
++ get_element(tail, size-(tail-payload), value, sizeof(value), &tail);
++ resp->pixels_per_line = strtol(value, NULL, 10);
++ }
++ else if (strncmp(tag, "ImageHeight", 11) == 0)
++ {
++ get_element(tail, size-(tail-payload), value, sizeof(value), &tail);
++ resp->lines = strtol(value, NULL, 10);
++ }
++ else if (strncmp(tag, "BytesPerLine", 12) == 0)
++ {
++ get_element(tail, size-(tail-payload), value, sizeof(value), &tail);
++ resp->bytes_per_line = strtol(value, NULL, 10);
++ }
++ }
++ return 0;
++}
++
+ static int parse_scan_elements(const char *payload, int size, struct wscn_scan_elements *elements)
+ {
+ char tag[512];
+@@ -762,8 +794,7 @@ int bb_get_parameters(struct ledm_session *ps, SANE_Parameters *pp, int option)
+ if (ps->currentCompression == SF_RAW && ps->currentScanMode != CE_GRAY8)
+ {
+ /* Set scan parameters based on scan job response values */
+- //pp->lines = pbb->job.lines;
+- pp->lines = (int)(SANE_UNFIX(ps->effectiveBry - ps->effectiveTly)/MM_PER_INCH*ps->currentResolution);
++ pp->lines = pbb->job.lines;
+ pp->pixels_per_line = pbb->job.pixels_per_line;
+ pp->bytes_per_line = pbb->job.bytes_per_line;
+ }
+@@ -784,8 +815,8 @@ int bb_get_parameters(struct ledm_session *ps, SANE_Parameters *pp, int option)
+ break;
+ case SPO_BEST_GUESS: /* called by xsane & sane_start */
+ /* Set scan parameters based on best guess. */
+- pp->lines = (int)round(SANE_UNFIX(ps->effectiveBry - ps->effectiveTly)/MM_PER_INCH*ps->currentResolution);
+- pp->pixels_per_line = (int)round(SANE_UNFIX(ps->effectiveBrx -ps->effectiveTlx)/MM_PER_INCH*ps->currentResolution);
++ pp->lines = (int)(SANE_UNFIX(ps->effectiveBry - ps->effectiveTly)/MM_PER_INCH*ps->currentResolution);
++ pp->pixels_per_line = ps->image_traits.iPixelsPerRow;
+ pp->bytes_per_line = BYTES_PER_LINE(pp->pixels_per_line, pp->depth * factor);
+ break;
+ default:
+@@ -889,7 +920,7 @@ SANE_Status bb_start_scan(struct ledm_session *ps)
+ (int) ((ps->currentBrx / 5548.7133) - (ps->currentTlx / 5548.7133)),//<Width>
+ (int) (ps->currentTly / 5548.7133),//<YStart>
+ (int) ((ps->currentBry / 5548.7133) - (ps->currentTly / 5548.7133)),//<Height>
+- "Jpeg",//<Format>
++ (ps->currentCompression == SF_RAW) ? "Raw" : "Jpeg", //<Format>
+ (! strcmp(ce_element[ps->currentScanMode], "Color8")) ? "Color" : (! strcmp(ce_element[ps->currentScanMode], "Gray8")) ? "Gray" : "Gray",//<ColorSpace>
+ ((! strcmp(ce_element[ps->currentScanMode], "Color8")) || (! strcmp(ce_element[ps->currentScanMode], "Gray8"))) ? 8: 8,//<BitDepth>
+ ps->currentInputSource == IS_PLATEN ? is_element[1] : is_element[2],//<InputSource>
+@@ -987,6 +1018,7 @@ SANE_Status bb_start_scan(struct ledm_session *ps)
+ _DBG("bb_start_scan() read_http_payload FAILED len=%d buf=%s\n", len, buf);
+ break;
+ }
++
+ //For a new scan, buf must contain <PreScanPage>.
+ if (NULL == strstr(buf,PRESCANPAGE))
+ { //i.e Paper is not present in Scanner
+@@ -1005,6 +1037,9 @@ SANE_Status bb_start_scan(struct ledm_session *ps)
+ stat = SANE_STATUS_GOOD;
+ goto bugout;
+ }
++ // Parse buf here
++ parse_status_elements(buf, len, &pbb->job);
++
+ usleep(500000);//0.5 sec delay
+ }//end while()
+
+diff --git a/scan/sane/ledm.c b/scan/sane/ledm.c
+index af86bff..65a7447 100644
+--- a/scan/sane/ledm.c
++++ b/scan/sane/ledm.c
+@@ -170,11 +170,11 @@ static int set_scan_mode_side_effects(struct ledm_session *ps, enum COLOR_ENTRY
+ case CE_GRAY8:
+ case CE_COLOR8:
+ default:
+-// ps->compressionList[j] = STR_COMPRESSION_NONE;
+-// ps->compressionMap[j++] = SF_RAW;
++ ps->compressionList[j] = STR_COMPRESSION_NONE;
++ ps->compressionMap[j++] = SF_RAW;
+ ps->compressionList[j] = STR_COMPRESSION_JPEG;
+ ps->compressionMap[j++] = SF_JPEG;
+- ps->currentCompression = SF_JPEG;
++ ps->currentCompression = SF_RAW;
+ ps->option[LEDM_OPTION_JPEG_QUALITY].cap |= SANE_CAP_SOFT_SELECT; /* enable jpeg quality */
+ break;
+ }
+@@ -679,7 +679,7 @@ SANE_Status ledm_control_option(SANE_Handle handle, SANE_Int option, SANE_Action
+ }
+ else
+ { /* Set default. */
+- ps->currentCompression = SF_JPEG;
++ ps->currentCompression = SF_RAW;
+ stat = SANE_STATUS_GOOD;
+ }
+ break;
+@@ -984,7 +984,9 @@ SANE_Status ledm_start(SANE_Handle handle)
+ }
+ }
+ else
+- ipGetImageTraits(ps->ip_handle, NULL, &ps->image_traits); /* get valid image traits */
++ {
++ ipGetOutputTraits(ps->ip_handle, &ps->image_traits); /* get valid image traits */
++ }
+
+ stat = SANE_STATUS_GOOD;
+