diff --git a/Tests/images/itxt_chunks.png b/Tests/images/itxt_chunks.png new file mode 100644 index 000000000..ca098440c Binary files /dev/null and b/Tests/images/itxt_chunks.png differ diff --git a/Tests/test_pickle.py b/Tests/test_pickle.py index 46958c085..45ef0f1db 100644 --- a/Tests/test_pickle.py +++ b/Tests/test_pickle.py @@ -67,9 +67,13 @@ class TestPickle(PillowTestCase): "Tests/images/non_zero_bb.png", "Tests/images/non_zero_bb_scale2.png", "Tests/images/p_trns_single.png", - "Tests/images/pil123p.png" + "Tests/images/pil123p.png", + "Tests/images/itxt_chunks.png" ]: - self.helper_pickle_string(pickle, test_file=test_file) + for protocol in range(0, pickle.HIGHEST_PROTOCOL + 1): + self.helper_pickle_string(pickle, + protocol=protocol, + test_file=test_file) def test_pickle_l_mode(self): # Arrange diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py index 4b8b10a51..e04ae2274 100644 --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -194,7 +194,7 @@ class iTXt(str): """ @staticmethod - def __new__(cls, text, lang, tkey): + def __new__(cls, text, lang=None, tkey=None): """ :param cls: the class to use when creating the instance :param text: value for this key