'Appends a text chunk.
:param key: latin-1 encodable text key name
:param value: value for this key, text or an
:py:class:`PIL.PngImagePlugin.iTXt` instance
:param zip: compression flag'

def add_text(self, key, value, zip=0):

    if isinstance(value, iTXt):
        return self.add_itxt(key, value, value.lang, value.tkey, bool(zip))
    if (not isinstance(value, bytes)):
        try:
            value = value.encode('latin-1', 'strict')
        except UnicodeError:
            return self.add_itxt(key, value, zip=bool(zip))
    if (not isinstance(key, bytes)):
        key = key.encode('latin-1', 'strict')
    if zip:
        self.add('zTXt', ((key + '\x00\x00') + zlib.compress(value)))
    else:
        self.add('tEXt', ((key + '\x00') + value))
