From 80393b6efa192e794edcb3f6d097f8aafffc957a Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sun, 3 Oct 2021 20:56:53 +0200 Subject: [PATCH] also support palette+alpha --- src/img2pdf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/img2pdf.py b/src/img2pdf.py index c658d18..4e6364d 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -85,7 +85,7 @@ FitMode = Enum("FitMode", "into fill exact shrink enlarge") PageOrientation = Enum("PageOrientation", "portrait landscape") -Colorspace = Enum("Colorspace", "RGB RGBA L LA 1 CMYK CMYK;I P other") +Colorspace = Enum("Colorspace", "RGB RGBA L LA 1 CMYK CMYK;I P PA other") ImageFormat = Enum("ImageFormat", "JPEG JPEG2000 CCITTGroup4 PNG GIF TIFF MPO other") @@ -1586,6 +1586,7 @@ def read_images(rawdata, colorspace, first_frame_only=False, rot=None): if ( color != Colorspace.RGBA and color != Colorspace.LA + and color != Colorspace.PA and "transparency" not in imgdata.info ): pngidat, palette = parse_png(rawdata) @@ -1783,6 +1784,7 @@ def read_images(rawdata, colorspace, first_frame_only=False, rot=None): if ( color == Colorspace.RGBA or color == Colorspace.LA + or color == Colorspace.PA or "transparency" in newimg.info ): if color == Colorspace.RGBA: