split _open in two parts

This commit is contained in:
Adrien CLERC 2019-02-15 22:07:11 +01:00
parent 30879dfb34
commit 3a7e2e259a

View File

@ -46,7 +46,10 @@ class MpoImageFile(JpegImagePlugin.JpegImageFile):
def _open(self):
self.fp.seek(0) # prep the fp in order to pass the JPEG test
JpegImagePlugin.JpegImageFile._open(self)
self.mpinfo = self._getmp()
self._after_jpeg_open(self._getmp())
def _after_jpeg_open(self, mpheader):
self.mpinfo = mpheader
self.__framecount = self.mpinfo[0xB001]
self.__mpoffsets = [mpent['DataOffset'] + self.info['mpoffset']
for mpent in self.mpinfo[0xB002]]