another small fixup for the last commit

pull/168/head
parent 7405635b72
commit 25466113e9
Signed by: josch
GPG Key ID: F2CBA5C78FBD83E1

@ -1435,7 +1435,7 @@ def get_imgmetadata(
# GIMP saves bilevel tiff images with an RGB ICC profile which # GIMP saves bilevel tiff images with an RGB ICC profile which
# is useless and produces an error in Adobe Acrobat -- ignore it # is useless and produces an error in Adobe Acrobat -- ignore it
if iccp is not None and color == Colorspace["1"] and imgformat == ImageFormat.TIFF: 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) prf = ImageCms.ImageCmsProfile(f)
if ( if (
prf.profile.model == "sRGB" prf.profile.model == "sRGB"
@ -1443,7 +1443,7 @@ def get_imgmetadata(
and prf.profile.profile_description == "GIMP built-in sRGB" and prf.profile.profile_description == "GIMP built-in sRGB"
): ):
logger.warning( 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") logger.warning("https://gitlab.gnome.org/GNOME/gimp/-/issues/9518")
iccp = None iccp = None

Loading…
Cancel
Save