Merge branch 'main' into png-alpha-to-smask

This commit is contained in:
Tamás Zahola 2021-06-18 23:09:43 +00:00
commit e2aa5e5aca

View file

@ -826,7 +826,9 @@ class pdfdoc(object):
elif color == Colorspace.CMYK or color == Colorspace["CMYK;I"]: elif color == Colorspace.CMYK or color == Colorspace["CMYK;I"]:
iccpdict[PdfName.N] = 4 iccpdict[PdfName.N] = 4
elif color == Colorspace.P: elif color == Colorspace.P:
raise Exception("Cannot have Palette images with ICC profile") # Only the png format can have an icc profile as well as a
# color palette. A png palette is always RGB.
iccpdict[PdfName.N] = 3
colorspace = [PdfName.ICCBased, iccpdict] colorspace = [PdfName.ICCBased, iccpdict]
# either embed the whole jpeg or deflate the bitmap representation # either embed the whole jpeg or deflate the bitmap representation