fp.tell resyncs the python3 with the file pointer

This commit is contained in:
wiredfool 2014-09-02 15:08:51 -07:00
parent d8b2829f4b
commit 17ac15543d

View File

@ -661,6 +661,9 @@ class TiffImageFile(ImageFile.ImageFile):
if Image.DEBUG:
print("Seeking to frame %s, on frame %s, __next %s, location: %s"%
(frame, self.__frame, self.__next, self.fp.tell()))
# reset python3 buffered io handle in case fp
# was passed to libtiff, invalidating the buffer
self.fp.tell()
self.fp.seek(self.__next)
if Image.DEBUG:
print("Loading tags, location: %s"%self.fp.tell())