def METHOD_NAME(self, mpheader=None):
    self._initial_size = self.size
    self.mpinfo = mpheader if mpheader is not None else self._getmp()
    self.n_frames = self.mpinfo[0xB001]
    self.__mpoffsets = [
        mpent["DataOffset"] + self.info["mpoffset"] for mpent in self.mpinfo[0xB002]
    ]
    self.__mpoffsets[0] = 0
    # Note that the following assertion will only be invalid if something
    # gets broken within JpegImagePlugin.
    assert self.n_frames == len(self.__mpoffsets)
    del self.info["mpoffset"]  # no longer needed
    self.is_animated = self.n_frames > 1
    self._fp = self.fp  # FIXME: hack
    self._fp.seek(self.__mpoffsets[0])  # get ready to read first frame
    self.__frame = 0
    self.offset = 0
    # for now we can only handle reading and individual frame extraction
    self.readonly = 1