src/img2pdf.py: use logging.warning because warn() is deprecated
This commit is contained in:
parent
d09aa76c9e
commit
90293204b2
1 changed files with 4 additions and 4 deletions
|
@ -638,10 +638,10 @@ def get_imgmetadata(imgdata, imgformat, default_dpi, colorspace, rawdata=None):
|
|||
ics = imgdata.mode
|
||||
|
||||
if ics in ["LA", "PA", "RGBA"]:
|
||||
logging.warn("Image contains transparency which cannot be retained in PDF.")
|
||||
logging.warn("img2pdf will not perform a lossy operation.")
|
||||
logging.warn("You can remove the alpha channel using imagemagick:")
|
||||
logging.warn(" $ convert input.png -background white -alpha remove -alpha off output.png")
|
||||
logging.warning("Image contains transparency which cannot be retained in PDF.")
|
||||
logging.warning("img2pdf will not perform a lossy operation.")
|
||||
logging.warning("You can remove the alpha channel using imagemagick:")
|
||||
logging.warning(" $ convert input.png -background white -alpha remove -alpha off output.png")
|
||||
raise Exception("Refusing to work on images with alpha channel")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue