Use zlib to zip ICC profiles
@@ -12,6 +12,7 @@ import string
import struct
import sys
import warnings
+import zlib
# Local module.
import png
@@ -50,7 +51,7 @@ def process(out, args):
args.chunk.insert(0, Chunk(b'sBIT', bs))
if args.iccprofile:
# http://www.w3.org/TR/PNG/#11iCCP
- v = 'a color profile\x00\x00' + args.iccprofile.read().encode('zip')
+ v = b'a color profile\x00\x00' + zlib.compress(args.iccprofile.read())
bs = io.BytesIO(v)
args.chunk.insert(0, Chunk(b'iCCP', bs))
