--- scan.py.orig 2018-08-16 13:19:11 UTC +++ scan.py @@ -220,7 +220,7 @@ try: 'subject=', 'to=', 'from=', 'jpg', 'grey-scale', 'gray-scale', 'about=', 'editor=', 'dp=', 'dest-printer=', 'dd=', - 'dest-device=', 'brightness=', + 'dest-device=', 'brightness=', ]) @@ -727,7 +727,7 @@ try: elif scan_mode == 'gray': scan_size = scan_px # 1 byte/px else: # lineart - scan_size = scan_px // 8 + scan_size = scan_px // 8 if scan_size > 52428800: # 50MB if res > 600: @@ -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) @@ -1148,7 +1149,7 @@ try: hp_print = utils.which("hp-print", True) if not hp_print: hp_print = 'python ./print.py' - + if dest_printer is not None: cmd = '%s -p %s %s &' % (hp_print, dest_printer, output) elif dest_devUri is not None: @@ -1157,7 +1158,7 @@ try: cmd = '%s -d %s %s &' % (hp_print, dest_devUri, output) else: cmd = '%s %s &' % (hp_print, output) - + os_utils.execute(cmd) elif d == 'email': @@ -1250,4 +1251,3 @@ except KeyboardInterrupt: log.info("") log.info("Done.") -