From 53685934f954014321390cadb1aac9525a40e433 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Fri, 17 Aug 2018 07:27:15 +0200 Subject: [PATCH] src/img2pdf.py: also reject palette images with transparency --- src/img2pdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/img2pdf.py b/src/img2pdf.py index 54fceef..5e2ed92 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -684,7 +684,7 @@ def get_imgmetadata(imgdata, imgformat, default_dpi, colorspace, rawdata=None): ndpi = (int(round(ndpi[0])), int(round(ndpi[1]))) ics = imgdata.mode - if ics in ["LA", "PA", "RGBA"]: + if ics in ["LA", "PA", "RGBA"] or "transparency" in imgdata.info: logging.warning("Image contains transparency which cannot be retained " "in PDF.") logging.warning("img2pdf will not perform a lossy operation.")