diff --git a/PIL/Image.py b/PIL/Image.py index 7c17a1682..f6aeb7c3c 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -598,7 +598,7 @@ class Image: id(self) ) - def _repr_png(self): + def _repr_png_(self): """ iPython display hook support :returns: png version of the image as bytes diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py index da5f73a0e..4cd5dc703 100644 --- a/Tests/test_file_png.py +++ b/Tests/test_file_png.py @@ -377,7 +377,7 @@ class TestFilePng(PillowTestCase): def test_repr_png(self): im = hopper() - repr_png = Image.open(BytesIO(im._repr_png())) + repr_png = Image.open(BytesIO(im._repr_png_())) self.assertEqual(repr_png.format, 'PNG') self.assert_image_equal(im, repr_png)