From 84ce9bbd9cadac831327fe0685a997857962c997 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Tue, 17 Jul 2018 16:26:32 +0200 Subject: [PATCH] src/img2pdf.py: do not allow transparency --- src/img2pdf.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/img2pdf.py b/src/img2pdf.py index 4fbfa19..abc4319 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -828,12 +828,8 @@ def read_images(rawdata, colorspace, first_frame_only=False): Colorspace["CMYK;I"], Colorspace.P]: logging.debug("Colorspace is OK: %s", color) newimg = imgdata - elif color in [Colorspace.RGBA, Colorspace.other]: - logging.debug("Converting colorspace %s to RGB", color) - newimg = imgdata.convert('RGB') - color = Colorspace.RGB else: - raise ValueError("unknown colorspace: %s" % color.name) + raise ValueError("unknown or unsupported colorspace: %s" % color.name) # cheapo version to retrieve a PNG encoding of the payload is to # just save it with PIL. In the future this could be replaced by # dedicated function applying the Paeth PNG filter to the raw pixel