From 4c5733de7c5a35aceaa9f99e15474f5e6606136f Mon Sep 17 00:00:00 2001 From: geka Date: Mon, 29 Feb 2016 13:59:24 +0300 Subject: [PATCH] fix bug in TiffImagePlugin. Save and restore pointer to super.load in _setup --- PIL/TiffImagePlugin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py index 096be6f56..15e39a743 100644 --- a/PIL/TiffImagePlugin.py +++ b/PIL/TiffImagePlugin.py @@ -1066,6 +1066,13 @@ class TiffImageFile(ImageFile.ImageFile): if 0xBC01 in self.tag_v2: raise IOError("Windows Media Photo files not yet supported") + try: + #restore pointer to load method + self.load = self._load + except AttributeError: + #save pointer to parent load method + self._load = super(TiffImageFile,self).load + # extract relevant tags self._compression = COMPRESSION_INFO[self.tag_v2.get(COMPRESSION, 1)] self._planar_configuration = self.tag_v2.get(PLANAR_CONFIGURATION, 1)