Here is a patch to add support for reading compressed text
chunks
(zTXt) and storing them in the info dictionary. With this
patch, both
compressed and uncompressed (tEXt) text chunks can be
accessed uniformly.
I've come across some text tag discussions on this mailing
list from
many years ago. Since then, it appears that some support
has been
added, but not for reading zTXt chunks. Since it has been a
while,
I'm going to ask that support for reading zTXt chunks be
considered again.
Previous discussions (patches):
http://mail.python.org/pipermail/image-sig/1998-
July/000529.html
http://mail.python.org/pipermail/image-sig/1999-M
ay/000737.html
Here is my patch. I borrowed ideas from the two patches
listed
above. It should apply cleanly against the 1.1.6 release.
diff -Naur Imaging-1.1.6/PIL/PngImagePlugin.py
Imaging-LCA/PIL/PngImagePlugin.py
--- Imaging-1.1.6/PIL/PngImagePlugin.py 2007-02-21
10:55:03.000000000 -0500
+++ Imaging-LCA/PIL/PngImagePlugin.py 2007-02-21
13:27:15.000000000 -0500
 -254,6
+254,19 
self.im_info[k] = v
return s
+ def chunk_zTXt(self, pos, len):
+ s = ImageFile._safe_read(self.fp, len)
+ (k, v) = string.split(s, " |