1
0
Fork 0
forked from josch/img2pdf

src/img2pdf.py: use logging.warning because warn() is deprecated

This commit is contained in:
Johannes 'josch' Schauer 2018-07-17 16:07:01 +02:00
parent d09aa76c9e
commit 90293204b2
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -638,10 +638,10 @@ def get_imgmetadata(imgdata, imgformat, default_dpi, colorspace, rawdata=None):
ics = imgdata.mode ics = imgdata.mode
if ics in ["LA", "PA", "RGBA"]: if ics in ["LA", "PA", "RGBA"]:
logging.warn("Image contains transparency which cannot be retained in PDF.") logging.warning("Image contains transparency which cannot be retained in PDF.")
logging.warn("img2pdf will not perform a lossy operation.") logging.warning("img2pdf will not perform a lossy operation.")
logging.warn("You can remove the alpha channel using imagemagick:") logging.warning("You can remove the alpha channel using imagemagick:")
logging.warn(" $ convert input.png -background white -alpha remove -alpha off output.png") logging.warning(" $ convert input.png -background white -alpha remove -alpha off output.png")
raise Exception("Refusing to work on images with alpha channel") raise Exception("Refusing to work on images with alpha channel")