hplip/Fix-scanning-with-python-pillow-4.2.0.patch
Johannes Meixner bc88c4621e Accepting request 621346 from home:mwilck:branches:Printing
- Fix scanning with python-pillow 4.2.0 (boo#1086755, #lp1741214)

- Fix bug in hpijs-avoid-segfault-in-DJGenericVIP-DJGenericVIP.patch:
  default behavior of DJ9xxVIP device must not be changed 

- avoid segfault in DJGenericVIP::DJGenericVIP() (boo#1094141, 
  lp#1774660)

OBS-URL: https://build.opensuse.org/request/show/621346
OBS-URL: https://build.opensuse.org/package/show/Printing/hplip?expand=0&rev=157
2018-07-09 11:03:41 +00:00

38 lines
1.1 KiB
Diff

From 72be09ee8482cdd19e0895f8f536854c2dafe535 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Tue, 12 Jun 2018 15:17:11 +0200
Subject: [PATCH] Fix scanning with python-pillow 4.2.0
python-pillow released new version (4.2.0), which forbids
saving RGBA data to JPEG. This behavior breaks scanning
by hp-scan. Output is:
$ hp-scan -m color -s file
Saving to file /home/zdohnal/hpscan001.jpg
error: Error saving file: cannot write mode RGBA as JPEG (I/O)
These RGBA data needs to be convert to RGB data before saving as JPEG
(other formats - PNG, PNM, TIFF etc. - works fine, because they doesn't
ignore A channel).
https://bugs.launchpad.net/hplip/+bug/1741214
---
scan.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/scan.py b/scan.py
index c33d84b..1ae4079 100755
--- a/scan.py
+++ b/scan.py
@@ -1078,6 +1078,7 @@ try:
log.info("Saving to file %s" % output)
try:
+ im = im.convert("RGB")
im.save(output)
except IOError as e:
log.error("Error saving file: %s (I/O)" % e)
--
2.17.0