From e265738ac28d749e0c1ad6f22c2f30bfee04ffb7 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sun, 3 Oct 2021 16:09:54 +0200 Subject: [PATCH] Revert "allow palette PNG images with ICC profile (closes: #107)" This reverts commit 3d7e0e6812b0398cb9bcc9c2d55cfef5d66a2e3f. --- src/img2pdf.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/img2pdf.py b/src/img2pdf.py index f38f557..c658d18 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -829,9 +829,7 @@ class pdfdoc(object): elif color == Colorspace.CMYK or color == Colorspace["CMYK;I"]: iccpdict[PdfName.N] = 4 elif color == Colorspace.P: - # 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 + raise Exception("Cannot have Palette images with ICC profile") colorspace = [PdfName.ICCBased, iccpdict] # either embed the whole jpeg or deflate the bitmap representation