src/img2pdf.py: also reject palette images with transparency

main
parent ba5a9a1dfc
commit 53685934f9
Signed by untrusted user: josch
GPG Key ID: F2CBA5C78FBD83E1

@ -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.")

Loading…
Cancel
Save