diff -Nru hplip-3.14.3/debian/changelog hplip-3.14.3/debian/changelog --- hplip-3.14.3/debian/changelog 2014-05-13 16:09:08.000000000 +0000 +++ hplip-3.14.3/debian/changelog 2015-06-23 02:09:35.000000000 +0000 @@ -1,3 +1,11 @@ +hplip (3.14.3-0ubuntu3.3) trusty; urgency=medium + + * Backport patch from vivid to allow non-JPEG scanning on the HP DeskJet 3520 + All-in-One and similar devices. Thanks to Lubos Dolezel for the patch. + Refreshed patch against trusty package (LP: #1245578) + + -- Micah Gersten Mon, 22 Jun 2015 21:05:26 -0500 + hplip (3.14.3-0ubuntu3.2) trusty-proposed; urgency=low * debian/rules: Corrected copy-and-paste error in previous release which diff -Nru hplip-3.14.3/debian/control hplip-3.14.3/debian/control --- hplip-3.14.3/debian/control 2014-01-09 19:59:12.000000000 +0000 +++ hplip-3.14.3/debian/control 2015-06-23 02:09:43.000000000 +0000 @@ -1,7 +1,8 @@ Source: hplip Section: utils Priority: optional -Maintainer: Debian HPIJS and HPLIP maintainers +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian HPIJS and HPLIP maintainers Uploaders: Mark Purcell , Till Kamppeter Build-Depends: libcups2-dev, libcupsimage2-dev, libsane-dev, libsnmp-dev, libjpeg-dev, libusb-1.0-0-dev [linux-any], libusb2-dev [kfreebsd-any], libusb-dev [!linux-any !kfreebsd-any], diff -Nru hplip-3.14.3/debian/patches/hpscan-deskjet-3520-aio-allow-non-jpeg-scanning.patch hplip-3.14.3/debian/patches/hpscan-deskjet-3520-aio-allow-non-jpeg-scanning.patch --- hplip-3.14.3/debian/patches/hpscan-deskjet-3520-aio-allow-non-jpeg-scanning.patch 1970-01-01 00:00:00.000000000 +0000 +++ hplip-3.14.3/debian/patches/hpscan-deskjet-3520-aio-allow-non-jpeg-scanning.patch 2015-06-23 02:05:18.000000000 +0000 @@ -0,0 +1,151 @@ +Description: Allow non-JPEG scanning + Allow non-JPEG scanning on the HP DeskJet 3520 All-in-One and similar + devices. +Author: Lubos Dolezel +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/1245578 +Forwarded: yes +Origin: distro, https://bugs.launchpad.net/ubuntu/+source/hplip/+bug/1245578/comments/8 +--- + scan/sane/bb_ledm.c | 47 +++++++++++++++++++++++++++++++++++++++++------ + scan/sane/ledm.c | 12 +++++++----- + 2 files changed, 48 insertions(+), 11 deletions(-) + +Index: hplip-3.14.3/scan/sane/bb_ledm.c +=================================================================== +--- hplip-3.14.3.orig/scan/sane/bb_ledm.c ++++ hplip-3.14.3/scan/sane/bb_ledm.c +@@ -189,7 +189,7 @@ + %d\ + %d\ + %s\ +-15\ ++0\ + %s\ + %d\ + %s\ +@@ -234,6 +234,38 @@ + # define JOBSTATE_COMPLETED "Completed" + # define 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 @@ + 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 @@ + 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: +@@ -883,7 +914,7 @@ + (int) ((ps->currentBrx / 5548.7133) - (ps->currentTlx / 5548.7133)),// + (int) (ps->currentTly / 5548.7133),// + (int) ((ps->currentBry / 5548.7133) - (ps->currentTly / 5548.7133)),// +- "Jpeg",// ++ (ps->currentCompression == SF_RAW) ? "Raw" : "Jpeg", // + (! strcmp(ce_element[ps->currentScanMode], "Color8")) ? "Color" : (! strcmp(ce_element[ps->currentScanMode], "Gray8")) ? "Gray" : "Gray",// + ((! strcmp(ce_element[ps->currentScanMode], "Color8")) || (! strcmp(ce_element[ps->currentScanMode], "Gray8"))) ? 8: 8,// + ps->currentInputSource == IS_PLATEN ? is_element[1] : is_element[2],// +@@ -979,6 +1010,7 @@ + _DBG("bb_start_scan() read_http_payload FAILED len=%d buf=%s\n", len, buf); + break; + } ++ + //For a new scan, buf must contain . + if (NULL == strstr(buf,PRESCANPAGE)) + { //i.e Paper is not present in Scanner +@@ -997,6 +1029,9 @@ + stat = SANE_STATUS_GOOD; + goto bugout; + } ++ // Parse buf here ++ parse_status_elements(buf, len, &pbb->job); ++ + usleep(500000);//0.5 sec delay + }//end while() + +Index: hplip-3.14.3/scan/sane/ledm.c +=================================================================== +--- hplip-3.14.3.orig/scan/sane/ledm.c ++++ hplip-3.14.3/scan/sane/ledm.c +@@ -170,11 +170,11 @@ + 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 @@ + } + else + { /* Set default. */ +- ps->currentCompression = SF_JPEG; ++ ps->currentCompression = SF_RAW; + stat = SANE_STATUS_GOOD; + } + break; +@@ -984,7 +984,9 @@ + } + } + 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; + diff -Nru hplip-3.14.3/debian/patches/series hplip-3.14.3/debian/patches/series --- hplip-3.14.3/debian/patches/series 2014-04-04 15:05:13.000000000 +0000 +++ hplip-3.14.3/debian/patches/series 2015-06-23 02:03:02.000000000 +0000 @@ -18,3 +18,4 @@ #hp-mkuri-libnotify-so-4-support.dpatch hpaio-option-duplex.diff musb-c-do-not-crash-on-usb-failure.patch +hpscan-deskjet-3520-aio-allow-non-jpeg-scanning.patch