diff --git a/PIL/PngImagePlugin.py b/PIL/PngImagePlugin.py index dd54707d8..2e2600166 100644 --- a/PIL/PngImagePlugin.py +++ b/PIL/PngImagePlugin.py @@ -731,7 +731,9 @@ def _save(im, fp, filename, chunk=putchunk): name = b"ICC Profile" data = name + b"\0\0" + zlib.compress(icc) chunk(fp, b"iCCP", data) - else: + + # You must either have sRGB or iCCP. + # Disallow sRGB chunks when a iCCP-chunk has been emitted. chunks.remove(b"sRGB") info = im.encoderinfo.get("pnginfo")