From 25466113e98743907a0271e9e6edacceb2577bd0 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Tue, 30 May 2023 08:06:36 +0200 Subject: [PATCH] another small fixup for the last commit --- src/img2pdf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/img2pdf.py b/src/img2pdf.py index a25dfff..a2bb812 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -1435,7 +1435,7 @@ def get_imgmetadata( # GIMP saves bilevel tiff images with an RGB ICC profile which # is useless and produces an error in Adobe Acrobat -- ignore it if iccp is not None and color == Colorspace["1"] and imgformat == ImageFormat.TIFF: - with io.BytesIO(imgdata.info.get("icc_profile")) as f: + with io.BytesIO(iccp) as f: prf = ImageCms.ImageCmsProfile(f) if ( prf.profile.model == "sRGB" @@ -1443,7 +1443,7 @@ def get_imgmetadata( and prf.profile.profile_description == "GIMP built-in sRGB" ): logger.warning( - "Ignoring RGB ICC profile for bilevel TIFF produced by GIMP." + "Ignoring RGB ICC profile in bilevel TIFF produced by GIMP." ) logger.warning("https://gitlab.gnome.org/GNOME/gimp/-/issues/9518") iccp = None